I\'m trying to implement a user policy whereby only one user can login at a time. I\'m trying to build this on top of Laravel\'s Auth driver.
I\'ve thought of using
This question is much earlier, but someone will be benefited through these easy steps. No need to make extra migration or something else.
The first step is to comment out the:
\Illuminate\Session\Middleware\AuthenticateSession::class,
line from App\Http Kernel.php class.
Secondly add this line in your login function just after login attempt successfully and before redirection:
\Auth::logoutOtherDevices(request('password'));
Thanks.