2024-08-30 23:13:46 -04:00
|
|
|
<?php
|
|
|
|
|
2025-01-30 00:23:55 -05:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2024-08-30 23:13:46 -04:00
|
|
|
namespace App\Jobs;
|
|
|
|
|
|
|
|
use App\Models\SptVersion;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
|
|
|
|
class SptVersionModCountsJob implements ShouldBeUnique, ShouldQueue
|
|
|
|
{
|
2025-01-30 00:23:55 -05:00
|
|
|
use Dispatchable;
|
|
|
|
use InteractsWithQueue;
|
|
|
|
use Queueable;
|
|
|
|
use SerializesModels;
|
2024-08-30 23:13:46 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Recalculate the mod counts for each SPT version.
|
|
|
|
*/
|
|
|
|
public function handle(): void
|
|
|
|
{
|
2025-01-30 00:23:55 -05:00
|
|
|
SptVersion::all()->each(function (SptVersion $sptVersion): void {
|
2024-08-30 23:13:46 -04:00
|
|
|
$sptVersion->updateModCount();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|