Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

EventServiceProvider.php 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace App\Providers;
  3. use App\Events\CompanyDefaultEvent;
  4. use App\Events\CompanyDefaultUpdated;
  5. use App\Events\CompanyGenerated;
  6. use App\Listeners\ConfigureCompanyDefault;
  7. use App\Listeners\CreateCompanyDefaults;
  8. use App\Listeners\SyncAssociatedModels;
  9. use App\Listeners\SyncWithCompanyDefaults;
  10. use Filament\Events\TenantSet;
  11. use Illuminate\Auth\Events\Registered;
  12. use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
  13. use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
  14. class EventServiceProvider extends ServiceProvider
  15. {
  16. /**
  17. * The event to listener mappings for the application.
  18. *
  19. * @var array<class-string, array<int, class-string>>
  20. */
  21. protected $listen = [
  22. Registered::class => [
  23. SendEmailVerificationNotification::class,
  24. ],
  25. CompanyDefaultEvent::class => [
  26. SyncWithCompanyDefaults::class,
  27. ],
  28. CompanyDefaultUpdated::class => [
  29. SyncAssociatedModels::class,
  30. ],
  31. TenantSet::class => [
  32. ConfigureCompanyDefault::class,
  33. ],
  34. CompanyGenerated::class => [
  35. CreateCompanyDefaults::class,
  36. ],
  37. ];
  38. /**
  39. * Register any events for your application.
  40. */
  41. public function boot(): void
  42. {
  43. //
  44. }
  45. /**
  46. * Determine if events and listeners should be automatically discovered.
  47. */
  48. public function shouldDiscoverEvents(): bool
  49. {
  50. return false;
  51. }
  52. }