You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
724 B

  1. <?php
  2. namespace App\Listeners;
  3. use App\Events\OrderShipped;
  4. use Illuminate\Contracts\Queue\ShouldQueue;
  5. // 事件监听器队列
  6. class SendShipmentNotificationQueue implements ShouldQueue
  7. {
  8. /**
  9. * 创建事件监听器
  10. *
  11. * @return void
  12. */
  13. public function __construct()
  14. {
  15. \Log::info('----SendShipmentNotificationQueue Listeners Init----');
  16. }
  17. /**
  18. * 处理事件
  19. *
  20. * @param OrderShipped $event
  21. * @return void
  22. */
  23. public function handle(OrderShipped $event)
  24. {
  25. \Log::info('----SendShipmentNotificationQueue Listeners handle----');
  26. }
  27. // 处理失败任务
  28. public function failed(OrderShipped $event, $exception)
  29. {
  30. //
  31. }
  32. }