| 12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace App\Jobs\Export;
- use App\Events\SendWebSocketMessageEvent;
- use App\Services\Export\ExportSparePartsService;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Foundation\Queue\Queueable;
- class ExportSparePartsJob implements ShouldQueue
- {
- use Queueable;
- /**
- * Create a new job instance.
- */
- public function __construct(private readonly int $userId)
- {
- }
- /**
- * Execute the job.
- */
- public function handle(ExportSparePartsService $service): void
- {
- $link = $service->handle($this->userId);
- event(new SendWebSocketMessageEvent(
- 'Экспорт каталога запчастей завершён!',
- $this->userId,
- ['link' => $link]
- ));
- }
- }
|