Files
scrum-poker-internal/app/Jobs/MarkInactivePlayers.php
T
2026-08-20 23:00:47 +02:00

23 lines
461 B
PHP

<?php
namespace App\Jobs;
use App\Models\Player;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
class MarkInactivePlayers implements ShouldQueue
{
use Queueable;
public function handle(): void
{
Player::query()
->whereNull('inactive_at')
->where('last_seen_at', '<=', now()->subHour())
->update([
'inactive_at' => now(),
]);
}
}