This commit is contained in:
Adrian Hopek
2022-04-08 12:42:24 +02:00
parent 4af0482a93
commit 6506855bba
50 changed files with 581 additions and 196 deletions

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
class TrackUserLastActivity
{
public function handle(Request $request, Closure $next)
{
$request->user()?->update([
"last_active_at" => Carbon::now(),
]);
return $next($request);
}
}