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.

30 lines
601 B

  1. <?php
  2. namespace App\Listeners;
  3. use App\Events\OrderShipped;
  4. class SendShipmentNotification
  5. {
  6. /**
  7. * 创建事件监听器
  8. *
  9. * @return void
  10. */
  11. public function __construct()
  12. {
  13. \Log::info('----SendShipmentNotification Listeners Init----');
  14. }
  15. /**
  16. * 处理事件
  17. *
  18. * @param OrderShipped $event
  19. * @return void
  20. */
  21. public function handle(OrderShipped $event)
  22. {
  23. // 使用 $event->order 发访问订单
  24. \Log::info('----SendShipmentNotification Listeners handle----');
  25. \Log::info('order_id:' . $event->order_id);
  26. }
  27. }