Skip to main content

Code Examples of events & listeners

Discover how to use Laravel's events & listeners method in real-world applications. Browse 23 examples from popular open-source projects.

23 examples
The main usage of the Events and Listeners pattern is that you can specify in the code that some event has just happened, and then there are Listener classes that automatically catch the Event and perform some action. You can attach one or multiple listener classes to one event.
In this way, you separate the code from the Controller to another layer, also helping the future developers who may want to expand functionality by listening to the same event.
An example may be the event "Registered User", which would have a couple of Listeners: one would send an email to the admin, another one would create some database records for that user, etc.
Read more in the official Laravel docs.

firefly-iii/firefly-iii

  • 21727
  • Created Jun 2014
  • Updated Dec 2025

Files in this example

  • app/Handlers/Events/StoredAccountEventHandler.php
    • app/Events/StoredAccount.php
      • app/Providers/EventServiceProvider.php
        • app/Factory/AccountFactory.php
View full example

koel/koel

  • 16892
  • Created Dec 2015
  • Updated Dec 2025

Files in this example

  • app/Listeners/DownloadArtistImage.php
    • app/Providers/EventServiceProvider.php
View full example

akaunting/akaunting

  • 9408
  • Created Sep 2017
  • Updated Dec 2025

Files in this example

  • app/Providers/Event.php
    • app/Events/Document/DocumentViewed.php
      • app/Listeners/Document/MarkDocumentViewed.php
        • app/Http/Controllers/Portal/Invoices.php
View full example

unopim/unopim

  • 8121
  • Created Jul 2024
  • Updated Nov 2025

Files in this example

  • packages/Webkul/Product/src/Providers/EventServiceProvider.php
    • packages/Webkul/Product/src/Listeners/Product.php
      • packages/Webkul/Admin/src/Http/Controllers/Catalog/ProductController.php
View full example

HiEventsDev/Hi.Events

  • 3374
  • Created Oct 2023
  • Updated Dec 2025

Files in this example

  • backend/app/Events/OrderStatusChangedEvent.php
    • backend/app/Listeners/Order/SendOrderDetailsEmailListener.php
      • backend/app/Services/Handlers/Order/CompleteOrderHandler.php
View full example

JhumanJ/OpnForm

  • 3042
  • Created Sep 2022
  • Updated Dec 2025

Files in this example

  • app/Providers/EventServiceProvider.php
    • app/Events/Models/FormCreated.php
      • app/Listeners/Forms/FormCreationConfirmation.php
View full example

laravelio/laravel.io

  • 2499
  • Created May 2016
  • Updated Dec 2025

Files in this example

  • app/Events/ArticleWasApproved.php
    • app/Providers/EventServiceProvider.php
      • app/Listeners/SendArticleApprovedNotification.php
View full example

Bottelet/DaybydayCRM

  • 2311
  • Created Jul 2016
  • Updated Mar 2025

Files in this example

  • app/Listeners/ProjectActionNotify.php
    • app/Providers/EventServiceProvider.php
      • app/Events/ProjectAction.php
        • app/Http/Controllers/ProjectsController.php
View full example

HDInnovations/UNIT3D-Community-Edition

  • 2255
  • Created Dec 2017
  • Updated Dec 2025

Files in this example

  • app/Providers/EventServiceProvider.php
    • app/Listeners/FailedLoginListener.php
View full example

nasirkhan/laravel-starter

  • 1362
  • Created Oct 2017
  • Updated Dec 2025

Files in this example

  • app/Providers/EventServiceProvider.php
    • /app/Listeners/Backend/UserCreated/UserCreatedProfileCreate.php
      • app/Http/Controllers/Backend/UserController.php
View full example

Paymenter/Paymenter

  • 1177
  • Created Jul 2024
  • Updated Dec 2025

Files in this example

  • app/Providers/EventServiceProvider.php
    • app/Extensions/Events/DiscordWebhook/DiscordWebhookListeners.php
View full example

range-of-motion/budget

  • 1058
  • Created Jul 2017
  • Updated Dec 2024

Files in this example

  • app/Events/ImportCreated.php
    • app/Models/Import.php
View full example

protonemedia/eddy-server-management

  • 507
  • Created May 2023
  • Updated Aug 2024

Files in this example

  • app/Events/SiteUpdated.php
    • app/Models/Site.php
View full example

nafiesl/free-pmo

  • 458
  • Created Nov 2017
  • Updated Oct 2025

Files in this example

  • app/Providers/EventServiceProvider.php
    • app/Events/Projects/Created.php
      • app/Listeners/Projects/LogProjectCreationActivity.php
View full example

agorakit/agorakit

  • 437
  • Created May 2016
  • Updated Dec 2025

Files in this example

  • app/Providers/EventServiceProvider.php
    • app/Http/Controllers/CommentController.php
      • app/Listeners/NotifyMentionedUsers.php
View full example

academico-sis/academico

  • 338
  • Created Dec 2018
  • Updated Nov 2025

Files in this example

  • app/Events/CourseUpdated.php
    • app/Listeners/UpdateCourseEvents.php
      • app/Providers/EventServiceProvider.php
        • app/Models/ExternalCourse.php
View full example

tighten/novapackages

  • 337
  • Created Feb 2020
  • Updated Nov 2025

Files in this example

  • app/Providers/EventServiceProvider.php
    • app/Http/Controllers/App/PackageController.php
      • app/Events/PackageCreated.php
        • app/Listeners/SendNewPackageNotification.php
View full example

LaraBug/larabug-app

  • 218
  • Created Apr 2021
  • Updated Oct 2023

Files in this example

  • app/Listeners/UpdateLoginData.php
    • app/Providers/EventServiceProvider.php
View full example

jcergolj/laravellte

  • 216
  • Created Jan 2020
  • Updated Feb 2023

Files in this example

  • app/Events/ProfileImageUploaded.php
    • app/Listeners/ResizeImage.php
      • app/Providers/EventServiceProvider.php
        • app/Http/Livewire/Profile/UpdateImage.php
View full example

SabatinoMasala/faceless-laravel-example

  • 124
  • Created Aug 2024
  • Updated Sep 2024

Files in this example

  • app/Events/StoryStatusUpdated.php
    • app/Models/Story.php
      • resources/js/Pages/Stories/Show.vue
View full example

OpenLitterMap/openlittermap-web

  • 123
  • Created Aug 2020
  • Updated Nov 2025

Files in this example

  • app/Providers/EventServiceProvider.php
    • app/Events/Photo/IncrementPhotoMonth.php
      • app/Listeners/UpdateTags/ResetCompileString.php
        • app/Listeners/UpdateTags/DecrementCity.php
View full example

JustinByrne/Mealing

  • 99
  • Created Oct 2020
  • Updated Sep 2022

Files in this example

  • app/Providers/EventServiceProvider.php
    • app/Events/UserVerified.php
      • app/Listeners/SendNewUserNotification.php
View full example

crivion/laraboard-careers

  • 79
  • Created Jul 2022
  • Updated May 2023

Files in this example

  • app/Events/JobApplicationReceivedEvent.php
    • app/Listeners/JobApplicationListener.php
      • app/Providers/EventServiceProvider.php
        • app/Http/Controllers/Front/StoreJobApplicationController.php
View full example

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.