TestServiceProvider.php 621 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Module\Game\Providers;
  3. use App\Module\Game\Events\TestEvent;
  4. use App\Module\Game\Listeners\TestEventListener;
  5. use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
  6. class TestServiceProvider extends ServiceProvider
  7. {
  8. /**
  9. * 事件到监听器的映射
  10. *
  11. * @var array<class-string, array<int, class-string>>
  12. */
  13. protected $listen = [
  14. TestEvent::class => [
  15. TestEventListener::class,
  16. ],
  17. ];
  18. /**
  19. * 注册任何事件监听器
  20. */
  21. public function boot(): void
  22. {
  23. parent::boot();
  24. }
  25. }