ExampleListener.php 564 B

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