Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace App\Jobs;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Queue\SerializesModels;
  5. use Illuminate\Queue\InteractsWithQueue;
  6. use Illuminate\Contracts\Queue\ShouldQueue;
  7. use Illuminate\Foundation\Bus\Dispatchable;
  8. use Illuminate\Support\Facades\Mail;
  9. use Exception;
  10. use App\Mail\AssignWorkOrder;
  11. use App\Model\WorkOrder;
  12. use App\Model\StaffDetail;
  13. use App\Model\Subscriber;
  14. use App\Model\Company;
  15. class SendWorkOrder implements ShouldQueue
  16. {
  17. use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
  18. public $work_order,$staff,$recipient,$customer,$company;
  19. /**
  20. * Create a new job instance.
  21. *
  22. * @return void
  23. */
  24. public function __construct(WorkOrder $work_order,StaffDetail $staff, $recipient,Subscriber $customer,Company $company)
  25. {
  26. //
  27. $this->work_order = $work_order;
  28. $this->recipient = $recipient;
  29. $this->staff = $staff;
  30. $this->customer = $customer;
  31. $this->company = $company;
  32. }
  33. /**
  34. * Execute the job.
  35. *
  36. * @return void
  37. */
  38. public function handle()
  39. {
  40. //
  41. Mail::to($this->recipient)->send(new AssignWorkOrder($this->work_order,$this->staff,$this->customer,$this->company));
  42. }
  43. public function failed(Exception $exception)
  44. {
  45. //
  46. }
  47. }