Published On Jan. 27th 2017

Laravel 5.4 From Scratch: Eventing

Episode 32 Run Time 9:09

Download
If you find that particular classes in your code base have become incredibly complicated, it might be worth considering a general observer model. That way, when a notable event takes place in your system (OrderRefunded, ThreadPublished, etc.), you only need to make an announcement to the rest of your application. Then, you may loosely register any number of handlers that will hook into this event, and respond as needed.