forge/app/Jobs/SptVersionModCountsJob.php
Refringe 09771d233a
Mod Filter Page - SPT Versions
Updated the mod filter page to only show SPT versions that have been tagged by mod versions.
2024-08-30 23:13:46 -04:00

27 lines
687 B
PHP

<?php
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
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Recalculate the mod counts for each SPT version.
*/
public function handle(): void
{
SptVersion::all()->each(function (SptVersion $sptVersion) {
$sptVersion->updateModCount();
});
}
}