Ad

Laravel FrozenNode Auth::check() Always Return False

Laravell 5.2 and FrozenNode/Laravel-Administrator 5.0.11.

Try to use:

'domain' => '',
'middleware' => array(),
   'permission'=> function()
        {
            return Auth::check();
        }

in config/administrator.php, but always get "False". In other places returns "True".

Ad

Answer

The problem is that the admin routes provided by FrozenNode are not inside the web middleware group, therefore they do not include any of the session information. No session, no logged in user.

You can easily fix this, however, by adding 'web' to the middleware key in your config file:

'domain' => '',
'middleware' => array('web'), // add 'web' middleware group
'permission'=> function() {
    return Auth::check();
}
Ad
source: stackoverflow.com
Ad