forked from admin/services_core
26 lines
644 B
PHP
26 lines
644 B
PHP
<?php
|
|
|
|
namespace App\Jobs;
|
|
|
|
use App\Models\NotificationBroadcast;
|
|
use App\Services\Notification\NotificationService;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Queue\Queueable;
|
|
|
|
class ProcessBroadcast implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
|
|
public int $tries = 3;
|
|
|
|
public function __construct(public int $broadcastId) {}
|
|
|
|
public function handle(NotificationService $service): void
|
|
{
|
|
$broadcast = NotificationBroadcast::with(['tenant', 'template', 'channelConfig'])->find($this->broadcastId);
|
|
if ($broadcast) {
|
|
$service->processBroadcast($broadcast);
|
|
}
|
|
}
|
|
}
|