Answers for "logout from specific guard in laravel"

PHP
0

laravel force user logout

if (!Auth::user()->isActive()) {
    Auth::logout();

    return Redirect::home();
}
Posted by: Guest on October-06-2020
0

where is the guard setting in laravel

You have to also register the guard in the config\auth.php

'guards' => [
    'web' => [
        'driver' => 'session',
        'provider' => 'users',
    ],

    'api' => [
        'driver' => 'token',
        'provider' => 'users',
    ],

     'admin' => [
        'driver' => 'session',
        'provider' => 'admins',
    ],
],
Posted by: Guest on April-13-2021

Browse Popular Code Answers by Language