您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

EventServiceProvider.php 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace App\Providers;
  3. use App\Events\CompanyConfigured;
  4. use App\Events\CompanyDefaultEvent;
  5. use App\Events\CompanyDefaultUpdated;
  6. use App\Events\CompanyGenerated;
  7. use App\Events\CurrencyRateChanged;
  8. use App\Events\DefaultCurrencyChanged;
  9. use App\Events\PlaidSuccess;
  10. use App\Events\StartTransactionImport;
  11. use App\Listeners\ConfigureChartOfAccounts;
  12. use App\Listeners\ConfigureCompanyDefault;
  13. use App\Listeners\CreateCompanyDefaults;
  14. use App\Listeners\CreateConnectedAccount;
  15. use App\Listeners\HandleTransactionImport;
  16. use App\Listeners\SyncAssociatedModels;
  17. use App\Listeners\SyncWithCompanyDefaults;
  18. use App\Listeners\UpdateAccountBalances;
  19. use App\Listeners\UpdateCurrencyRates;
  20. use Illuminate\Auth\Events\Registered;
  21. use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
  22. use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
  23. class EventServiceProvider extends ServiceProvider
  24. {
  25. /**
  26. * The event to listener mappings for the application.
  27. *
  28. * @var array<class-string, array<int, class-string>>
  29. */
  30. protected $listen = [
  31. Registered::class => [
  32. SendEmailVerificationNotification::class,
  33. ],
  34. CompanyDefaultEvent::class => [
  35. SyncWithCompanyDefaults::class,
  36. ],
  37. CompanyDefaultUpdated::class => [
  38. SyncAssociatedModels::class,
  39. ],
  40. CompanyConfigured::class => [
  41. ConfigureCompanyDefault::class,
  42. ],
  43. CompanyGenerated::class => [
  44. CreateCompanyDefaults::class,
  45. ConfigureChartOfAccounts::class,
  46. ],
  47. DefaultCurrencyChanged::class => [
  48. UpdateCurrencyRates::class,
  49. ],
  50. CurrencyRateChanged::class => [
  51. UpdateAccountBalances::class,
  52. ],
  53. PlaidSuccess::class => [
  54. CreateConnectedAccount::class,
  55. ],
  56. StartTransactionImport::class => [
  57. HandleTransactionImport::class,
  58. ],
  59. ];
  60. /**
  61. * The model observers to register.
  62. *
  63. * @var array<string, string|object|array<int, string|object>>
  64. */
  65. protected $observers = [
  66. // Currency::class => [CurrencyObserver::class],
  67. ];
  68. /**
  69. * Register any events for your application.
  70. */
  71. public function boot(): void
  72. {
  73. //
  74. }
  75. /**
  76. * Determine if events and listeners should be automatically discovered.
  77. */
  78. public function shouldDiscoverEvents(): bool
  79. {
  80. return false;
  81. }
  82. }