I am facing an issue with Auth, I have admin middleware and handle function inside, but Auth::check
always return false. Seems like user session doesn't exist.
I thought the problem was in permissions for /storage
and /bootstrap/cache
, but when I set up 777
for these folders the problem still the same. Session folder is not empty.
I have tried to clear cache.
My Admin Middleware:
public function handle($request, Closure $next)
{
//check the proper role
if (Auth::check() && Auth::user()->isAdmin()) {
return $next($request);
}
else {
return response()->view('auth.forbidden')->header('Content-Type', 'text/html');
}
}
Any Ideas?
Thanks
Route::group(array('prefix' => 'admin', 'middleware' => 'web'), function() { Route::get('/',[ 'uses' => 'Back\AdminController@index', 'as' => 'admin.index', 'middleware' => 'admin' ]); });
– zm_fans Aug 01 '17 at 07:03