You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

EventServiceProvider.php 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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\ConfigureCompanyNavigation;
  14. use App\Listeners\CreateCompanyDefaults;
  15. use App\Listeners\CreateConnectedAccount;
  16. use App\Listeners\HandleTransactionImport;
  17. use App\Listeners\PopulateAccountFromPlaid;
  18. use App\Listeners\SyncAssociatedModels;
  19. use App\Listeners\SyncTransactionsFromPlaid;
  20. use App\Listeners\SyncWithCompanyDefaults;
  21. use App\Listeners\UpdateAccountBalances;
  22. use App\Listeners\UpdateCurrencyRates;
  23. use App\Models\Accounting\Account;
  24. use App\Models\Accounting\JournalEntry;
  25. use App\Models\Banking\BankAccount;
  26. use App\Models\Setting\Currency;
  27. use App\Observers\AccountObserver;
  28. use App\Observers\BankAccountObserver;
  29. use App\Observers\CurrencyObserver;
  30. use App\Observers\JournalEntryObserver;
  31. use Illuminate\Auth\Events\Registered;
  32. use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
  33. use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
  34. class EventServiceProvider extends ServiceProvider
  35. {
  36. /**
  37. * The event to listener mappings for the application.
  38. *
  39. * @var array<class-string, array<int, class-string>>
  40. */
  41. protected $listen = [
  42. Registered::class => [
  43. SendEmailVerificationNotification::class,
  44. ],
  45. CompanyDefaultEvent::class => [
  46. SyncWithCompanyDefaults::class,
  47. ],
  48. CompanyDefaultUpdated::class => [
  49. SyncAssociatedModels::class,
  50. ],
  51. CompanyConfigured::class => [
  52. ConfigureCompanyDefault::class,
  53. ConfigureCompanyNavigation::class,
  54. ],
  55. CompanyGenerated::class => [
  56. CreateCompanyDefaults::class,
  57. ConfigureChartOfAccounts::class,
  58. ],
  59. DefaultCurrencyChanged::class => [
  60. UpdateCurrencyRates::class,
  61. ],
  62. CurrencyRateChanged::class => [
  63. UpdateAccountBalances::class,
  64. ],
  65. PlaidSuccess::class => [
  66. CreateConnectedAccount::class,
  67. // PopulateAccountFromPlaid::class,
  68. // SyncTransactionsFromPlaid::class,
  69. ],
  70. StartTransactionImport::class => [
  71. // SyncTransactionsFromPlaid::class,
  72. HandleTransactionImport::class,
  73. ],
  74. ];
  75. /**
  76. * The model observers to register.
  77. *
  78. * @var array<string, string|object|array<int, string|object>>
  79. */
  80. protected $observers = [
  81. Currency::class => [CurrencyObserver::class],
  82. BankAccount::class => [BankAccountObserver::class],
  83. Account::class => [AccountObserver::class],
  84. JournalEntry::class => [JournalEntryObserver::class],
  85. ];
  86. /**
  87. * Register any events for your application.
  88. */
  89. public function boot(): void
  90. {
  91. //
  92. }
  93. /**
  94. * Determine if events and listeners should be automatically discovered.
  95. */
  96. public function shouldDiscoverEvents(): bool
  97. {
  98. return false;
  99. }
  100. }