r/laravel•
Boye

Why isn't route::group([]) mentioned in the documentation?

Discussion

I can see that prefix, name, middleware and many other methods for grouping routes are mentioned in the documentation, but nowhere do I see Group()?

This allows me to define several groups in one go:

Route::group(['middleware'=> 'auth', 'prefix'=>'users', 'name'=>'user'], function({});

is it considered bad practice? I like to use this, at is allows me to group a large number of routes without a lot of indentation.

Posted May 13, 2024, 3:37 PM UTC

89

Comments aren't archived yet

This post had 9 comments on Reddit. Comments for this period haven't been loaded into the archive yet.