1
0
Fork 0

Update ApiV1Controller

This commit is contained in:
Daniel Supernault 2021-01-14 18:51:19 -07:00
parent 56256cb037
commit 51f8fe5bde
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 9 additions and 7 deletions

View File

@ -1435,13 +1435,15 @@ class ApiV1Controller extends Controller
$limit = $request->input('limit') ?? 3;
$user = $request->user();
$key = 'user:last_active_at:id:'.$user->id;
$ttl = now()->addMinutes(5);
Cache::remember($key, $ttl, function() use($user) {
$user->last_active_at = now();
$user->save();
return;
});
if($user) {
$key = 'user:last_active_at:id:'.$user->id;
$ttl = now()->addMinutes(5);
Cache::remember($key, $ttl, function() use($user) {
$user->last_active_at = now();
$user->save();
return;
});
}
if($min || $max) {
$dir = $min ? '>' : '<';