I want to apply two middlewares to some routes in Laravel.
Route::group(['middleware' => ('auth_guest'), 'prefix' => 'guest/'], function() {
// 60 routes
});
I know two solutions:
1- Apply the middleware on the controller's constructor.
2- Combine both middlewares and make it one.
Although both would work I would like to keep both middlewares separated.
Is there a way to apply both middlewares in a group?
Something like:
Route::group(['middleware' => ('auth_guest'), 'prefix' => 'guest/'], function() {
Route::group(['middleware' => ('isgreat')], function() {
//60 routes
});
});