ExampleListener.php 495 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Listeners;
  3. use App\Events\ExampleEvent;
  4. use Illuminate\Support\Facades\Log;
  5. class ExampleListener
  6. {
  7. /**
  8. * Create the event listener.
  9. *
  10. * @return void
  11. */
  12. public function __construct()
  13. {
  14. //
  15. }
  16. /**
  17. * Handle the event.
  18. *
  19. * @param ExampleEvent $event
  20. * @return void
  21. */
  22. public function handle(ExampleEvent $event)
  23. {
  24. //
  25. Log::info('事件监听执行了');
  26. return;
  27. }
  28. }