1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 13:24:03 +00:00
laravel-tips/content/tips/create-subscribers-to-listen-to-amp-handle-multiple-events-using-separate-methods-inside-a-single-class.md
2022-02-28 12:25:21 +01:00

726 B

title tweet_id thread_slug author_username images created_at slug
Create Subscribers to listen to & handle multiple events using separate methods, inside a single class 1498010791303282688 weekly-thread-2022-08 bobbybouwmann
https://pbs.twimg.com/media/FMJNvELWYAs0iij.jpg
2022-02-27T19:02:58+00:00 create-subscribers-to-listen-to-amp-handle-multiple-events-using-separate-methods-inside-a-single-class

Did you know that you can create a "Subscriber" class in Laravel to handle multiple events with different methods in one Listener class?

This is very useful if you want to group certain actions with the same dependencies.

Documentation: https://laravel.com/docs/9.x/events#event-subscribers