Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

setuk's avatar
Level 1

Laravel 9 Route Groups

Is the Route::group syntax still supported in Laravel 9 - I was looking through the doc and couldn't find any specific mention but I see the method still exists on the class. I want to group middlewares, prefixes and namespaces together.

Route::group(['middleware' => ['auth'], 'namespace'=>'Admin', 'prefix'=>'admin'], function () { //Profile, About Route::get('profile/index', 'PersonalController@index')->name('admin.profile'); Route::view('about', 'admin.about')->name('admin.about'); });

0 likes
2 replies
MichalOravec's avatar
Level 75
Route::prefix('admin')->namespace('Admin')->middleware(['auth'])->group(function () { 
    //
});
1 like

Please or to participate in this conversation.