optimizations
This commit is contained in:
30
app/Jobs/UpdateNovaCardStatsJob.php
Normal file
30
app/Jobs/UpdateNovaCardStatsJob.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\NovaCard;
|
||||
use App\Services\NovaCards\NovaCardTrendingService;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class UpdateNovaCardStatsJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function __construct(private readonly int $cardId) {}
|
||||
|
||||
public function handle(NovaCardTrendingService $trending): void
|
||||
{
|
||||
$card = NovaCard::query()->find($this->cardId);
|
||||
if (! $card) {
|
||||
return;
|
||||
}
|
||||
|
||||
$trending->refreshCard($card);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user