SendTestEmail.php 774 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Jobs;
  3. use Illuminate\Contracts\Mail\Mailer;
  4. use Illuminate\Contracts\Queue\ShouldQueue;
  5. use Illuminate\Foundation\Bus\Dispatchable;
  6. use Illuminate\Queue\InteractsWithQueue;
  7. use Illuminate\Queue\SerializesModels;
  8. class SendTestEmail extends Job implements ShouldQueue
  9. {
  10. use Dispatchable, InteractsWithQueue, SerializesModels;
  11. protected $user;
  12. /**
  13. * Create a new job instance.
  14. *
  15. * @return void
  16. */
  17. public function __construct($user)
  18. {
  19. //
  20. $this->user = $user;
  21. }
  22. /**
  23. * Execute the job.
  24. *
  25. * @return void
  26. */
  27. public function handle(Mailer $mailer)
  28. {
  29. //
  30. \Log::info('============延迟队列执行=========');
  31. \Log::info($this->user);
  32. }
  33. }