есть 3 способа, какой-нибудь да подойдет
1.
// https://laravel.com/docs/8.x/authentication#invalidating-sessions-on-other-devices
Auth::logoutOtherDevices($currentPassword);
2.
// php artisan make:middleware LogoutUsers
// app/Http/Kernel.php -> $middlewareGroups -> web
<?php
namespace App\Http\Middleware;
use Auth;
use Closure;
class LogoutUsers
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (!auth()->check()) {
return $next($request);
}
$user = Auth::user();
if ($user->logout === false) {
$user->update(['logout' => true]);
Auth::logout();
return redirect()->route('login');
}
return $next($request);
}
}
3.
//текущий юзер
$user = Auth::user();
//выход конкретного юзера
$userToLogout = User::find(5);
Auth::setUser($userToLogout);
Auth::logout();
//возвращаем текущего юзера
Auth::setUser($user);