Controller Route Groups Laravel

Created 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

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

Don't forget to share this article! Help us spread the word by clicking the share button below.

We appreciate your support and are committed to providing you valuable and informative content.

We are thankful for your never ending support.