How can override routes, models, controllers?
-
I need to override:
- Some admin routes which located in
packages/Webkul/Admin/src/Http/routes.php - Some category controller methods which located in
packages/Webkul/Category/src/Http/Controllers/CategoryController.php - Category model to add an attribute to it
What is the best practice to do that?
Thanks a lot for helping and giving good advises - Some admin routes which located in
-
In simple, just assume you are overriding the
vendorfolder. How will you do it?-
First, if you building some package then overriding inside your package.
-
Second, Laravel
appfolder where everything is already registered for you. Just register the same route in theweb.phpfile and transfer your route to the controller where you want. Laravel always hit the top-level route.
-