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
Override the UserCrudController to add extra fields #254
Comments
Ok I resolved it by adding to the routes\web.php
And removed the I believe this is cause by the auto-discover of the package. It's loading the routes/backpack/custom.php after the web.php. I tried tweaking the config/app.php to load BackpackServiceProvider and PermissionManagerServiceProvider before RouteServiceProvider but I did not work. I'll keep this open in case someone had a better solution. |
Another solution I found is to bind the Controllers in my AppServiceProvider:
Again, please let me know if there's a better solution. |
This question is probably better suited to Stack Overflow tagged with Because the Permission manager is an addon, it has it's own custom route file for overriding the default routes Inside
Now these routes will be loaded instead of the package's default routes. You can see how this behavior is controlled in the |
@lambasoft , @DoDSoftware on second thought... I actually started liking @lambasoft 's method better 🤣 What do you think, should we make that the recommended method? Please let me know in this other thread - Laravel-Backpack/community-forum#90 |
I created a migration that changes name to 'first_name' and 'last_name' in the users table, and I want to update the required fields to the UserCrudController, so I created the following UserCrudController that extends the original:
In my routes/backpack/custom.php I have the following:
But it's not working. The UserCrudController is not being overriden. It's still using the original one.
Any idea how to override the route to the new controller?
The text was updated successfully, but these errors were encountered: