Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Builder Macroable or change Menu::make #216

Open
ThomasRitter75 opened this issue May 2, 2018 · 0 comments
Open

Make Builder Macroable or change Menu::make #216

ThomasRitter75 opened this issue May 2, 2018 · 0 comments

Comments

@ThomasRitter75
Copy link

Menu::make creates a Builder instance and adds it to its internal $menu array before calling the callback. This way users can't use a subclass of Builder with custom methods implementing per-application helpers to drastically reduce Boilerplate code.

This can be changed in two ways:

  1. The OOP way: Add $builder=null argument to Menu::make and that builder instance (if not null) will be used instead of a newly created one. This way a user can give a subclass of Builder and have convenient methods for his/her own application.

  2. The Laravel Way: Make the Builder class Macroable, just by using the Trait Macroable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants