EventServiceProvider.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. namespace App\Providers;
  3. use App\Events\PaymentEvent;
  4. use App\Events\UserUpdateCreditsEvent;
  5. use App\Events\CouponUsedEvent;
  6. use App\Listeners\CouponUsed;
  7. use App\Listeners\CreateInvoice;
  8. use App\Listeners\UnsuspendServers;
  9. use App\Listeners\UserPayment;
  10. use App\Listeners\Verified as ListenerVerified;
  11. use Illuminate\Auth\Events\Registered;
  12. use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
  13. use Illuminate\Auth\Events\Verified;
  14. use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
  15. use SocialiteProviders\Manager\SocialiteWasCalled;
  16. class EventServiceProvider extends ServiceProvider
  17. {
  18. /**
  19. * The event listener mappings for the application.
  20. *
  21. * @var array
  22. */
  23. protected $listen = [
  24. Registered::class => [
  25. SendEmailVerificationNotification::class,
  26. ],
  27. UserUpdateCreditsEvent::class => [
  28. UnsuspendServers::class,
  29. ],
  30. PaymentEvent::class => [
  31. CreateInvoice::class,
  32. UserPayment::class,
  33. ],
  34. CouponUsedEvent::class => [
  35. CouponUsed::class
  36. ],
  37. SocialiteWasCalled::class => [
  38. // ... other providers
  39. 'SocialiteProviders\\Discord\\DiscordExtendSocialite@handle',
  40. ],
  41. Verified::class => [
  42. ListenerVerified::class,
  43. ],
  44. ];
  45. /**
  46. * Register any events for your application.
  47. *
  48. * @return void
  49. */
  50. public function boot()
  51. {
  52. //
  53. }
  54. /**
  55. * Determine if events and listeners should be automatically discovered.
  56. *
  57. * @return bool
  58. */
  59. public function shouldDiscoverEvents()
  60. {
  61. return false;
  62. }
  63. }