EventServiceProvider.php 850 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Providers;
  3. use App\Events\PostPublished;
  4. use App\Events\PostScheduled;
  5. use App\Events\CommentCreated;
  6. use App\Events\CommentApproved;
  7. use App\Listeners\SendPostPublishedNotification;
  8. use App\Listeners\LogPostScheduled;
  9. use App\Listeners\NotifyAdminAboutComment;
  10. use App\Listeners\NotifyCommentAuthor;
  11. use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
  12. class EventServiceProvider extends ServiceProvider
  13. {
  14. protected $listen = [
  15. PostPublished::class => [
  16. SendPostPublishedNotification::class,
  17. ],
  18. PostScheduled::class => [
  19. LogPostScheduled::class,
  20. ],
  21. CommentCreated::class => [
  22. NotifyAdminAboutComment::class,
  23. ],
  24. CommentApproved::class => [
  25. NotifyCommentAuthor::class,
  26. ],
  27. ];
  28. }