Controller Route Groups Laravel

Updated at 22-Aug-2022, By samar

Controller Route Groups Laravel

Hello everyone, in this post we will examine how to solve the "Controller Route Groups Laravel" programming puzzle.

You may now use the controller method to define the common controller for all of the routes within the group in Laravel 9 in `routes/web.php`.
  • routes\web.php

    use App\Http\Controllers\OrderController;
     
    Route::controller(OrderController::class)->group(function () {
        Route::get('/orders/{id}', 'show');
        Route::post('/orders', 'store');
    });
    

Back to code snippet queries related laravel