| 12345678910111213141516171819202122232425262728 |
- <?php
- declare(strict_types=1);
- namespace App\Jobs\Export;
- use App\Events\SendWebSocketMessageEvent;
- use App\Services\Export\ExportCommonCatalogService;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Foundation\Queue\Queueable;
- class ExportCommonCatalogJob implements ShouldQueue
- {
- use Queueable;
- public function __construct(private readonly int $userId) {}
- public function handle(ExportCommonCatalogService $service): void
- {
- $link = $service->handle($this->userId);
- event(new SendWebSocketMessageEvent(
- 'Экспорт общего каталога завершён!',
- $this->userId,
- ['link' => $link],
- ));
- }
- }
|