Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5 lockscreen

So, I'm doing this app in Laravel and my client wants it to have a "lockscreen" after 3 minutes of inactivity, something like what new PayPal site is doing. So if you're not active for 3 minutes you are presented with lockscreen view and you have to type in your password to retrieve the session.

It would be awesome if I could achieve this without messing with core files, like via controller and new middleware.

like image 652
D. Look Avatar asked Jan 17 '26 19:01

D. Look


1 Answers

You could use sessions for this and check for the time use waited with each new request. You could use middleware for that.

$request->session()->put('expire_time', \Carbon::now()->addMinutes(3));
like image 152
Alexey Mezenin Avatar answered Jan 20 '26 14:01

Alexey Mezenin