ImportCatalog.php 745 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Jobs\Import;
  3. use App\Events\SendWebSocketMessageEvent;
  4. use Illuminate\Contracts\Queue\ShouldBeUniqueUntilProcessing;
  5. use Illuminate\Contracts\Queue\ShouldQueue;
  6. use Illuminate\Foundation\Queue\Queueable;
  7. use Illuminate\Support\Facades\Log;
  8. class ImportCatalog implements ShouldQueue, ShouldBeUniqueUntilProcessing
  9. {
  10. use Queueable;
  11. /**
  12. * Create a new job instance.
  13. */
  14. public function __construct(private readonly int $year, private readonly string $path)
  15. {
  16. //
  17. }
  18. /**
  19. * Execute the job.
  20. */
  21. public function handle(): void
  22. {
  23. Log::info('ImportCatalog job done!');
  24. // make event
  25. event(new SendWebSocketMessageEvent('TEsttttd', 1));
  26. }
  27. }