0
在我的项目中我需要保护一些视图。我在现场控制user auth Laravel 5.2
Route::group(['middleware' => ['auth']], function(){
//Spot
Route::get('administrator/spot-new', '[email protected]');
Route::post('administrator/spot-new', '[email protected]');
}
: 我创建了一个路由器组
public function __construct()
{
$this->middleware('auth');
}
但是当我尝试进入现场查看,我不能看到登录页面。 我有这个错误: 对不起,找不到您正在寻找的页面。
检查了这一点,也许它可以帮助你http://stackoverflow.com/questions/36567068/laravel-5-2-auth-registration-page-blocked/36567538#36567538 –
使用[“中间件” => ['web','auth']] –
in Authenticate middleware if(Auth :: guard($ guard) - > guest()){$ request-> ajax()|| $ request-> wantsJson()){ return response('Unauthorized。',401); } else { return redirect() - > guest('auth/login'); } } –