Laravel for Beginners – Learn to Build Full-Stack Web Apps

Loading video...

Grouping Routes by Controller

Controllers

Group actions by controller

If you want to associate multiple methods of your controller to routes, you can use the controller name only once.

Route::controller(\App\Http\Controllers\CarController::class)->group(function () {
    Route::get("/car", "index");
    Route::get("/my-cars", "myCars");
    Route::get("/search", "search");
});

Discussion

Sign in to join the discussion.

No comments yet. Be the first to start the discussion!