I want to use multi authenticate in Laravel 5.2
. But I found a strange problem.
Here is my code in route.php
.
However I can not get $errors
in the login.blade.php
, it just returns null
.
<?php
Route::group(['middleware' => ['web'], 'namespace' => 'Admin', 'prefix' => 'admin'], function () {
Route::auth();
});
?>
But when I remove the web middleware, it works.
<?php
Route::group(`enter code here`['namespace' => 'Admin', 'prefix' => 'admin'], function () {
Route::auth();
});
?>
I don't know why. My understanding is that when I want to use the session, I must use the web middleware.
Because on Laravel 5.2 the web
middleware is automatically applied, your routes in routes.php
are grouped with prefix App\\Http\\Controllers
and web
middleware. You can find this definition on mapWebRoutes()
method of the RouteServiceProdiver.php
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.