Inicio de sesión automático Cuando la sesión expira a Laravel
# Session lifetime in minutes
SESSION_LIFETIME=10
Ugly Unicorn
# Session lifetime in minutes
SESSION_LIFETIME=10
class LoginController extends Controller
{
// ...
protected function authenticated(Request $request, $user)
{
$user->last_seen_at = Carbon::now()->format('Y-m-d H:i:s');
$user->save();
}
}
class Kernel extends HttpKernel
{
// ...
protected $middlewareGroups = [
'web' => [
// ...
\App\Http\Middleware\SessionTimeout::class,
],
}