Routes in Laravel

Asked

Viewed 118 times

1

When prefixing the middleware auth, as below, I am automatically implementing also middleware web?

Route::group(['prefix' => 'painel', 'middleware' => 'auth'], function() {
    //
}
  • web php. is the route, right? Not a Middleware

  • we actually have several middleware or middleware groups, one of which is the web as can be verified in the Kernel.php file, my question is, when applying auth I also have to apply middlewareGroups web?

1 answer

1


It is not necessarily middleware auth that automatically implements the web. In fact, at least in Laravel 5.2, according to the documentation the web middleware is automatically implemented in the Routes.php file by Routeserviceprovider.

Keep in Mind, the web middleware group is Automatically Applied to your default Routes.php file by the Routeserviceprovider.

https://laravel.com/docs/5.2/middleware

Browser other questions tagged

You are not signed in. Login or sign up in order to post.