laravel-blog icon indicating copy to clipboard operation
laravel-blog copied to clipboard

Refactor routes to use Resource Controllers

Open Nima8FT opened this issue 1 month ago • 1 comments

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 avatar Nov 04 '25 06:11 Nima8FT

@Nima8FT Hi!

I agree with your arguments. If you have time, you can make some edits and create a PR with them.

gomzyakov avatar Nov 16 '25 07:11 gomzyakov