laravel-blog
laravel-blog copied to clipboard
Refactor routes to use Resource Controllers
Currently, multiple routes in the project use separate controllers for each CRUD action. For example:
- User: IndexController, CreateController, StoreController, ShowController, EditController, UpdateController, DeleteController
- Category: IndexController, CreateController, etc.
- Post: IndexController, CreateController, etc.
This approach leads to many small controllers and repetitive route definitions.
Proposal:
- Combine each resource's controllers into a single Laravel Resource Controller (e.g., UserController, CategoryController, PostController)
- Use Route::resource() to define all routes
- This will simplify route management, reduce boilerplate, and improve maintainability
@Nima8FT Hi!
I agree with your arguments. If you have time, you can make some edits and create a PR with them.