Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Bottelet/DaybydayCRM

2311 stars
1 code files
View Bottelet/DaybydayCRM on GitHub

app/Http/Middleware/LogLastUserActivity.php

Open in GitHub
use Closure;
use Cache;
use Carbon;
 
class LogLastUserActivity
{
public function handle($request, Closure $next)
{
if (\Auth::check()) {
$expiresAt = Carbon::now()->addMinutes(5);
Cache::put('user-is-online-' . \Auth::user()->id, true, $expiresAt);
}
return $next($request);
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.