Laravel: Are Observers really evil?

Is the developer out of touch? No, is the framework who is wrong…

Photo by Possessed Photography on Unsplash

Observer best practices

1. Observers have one responsibility

2. Observers hear multiple events

3. Observers may use Dependency Injection

4. Observers may be tested

5. Observers may be shared

6. Observers can be registered in the Model too



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Italo Baeza Cabrera

Graphic Designer graduate. Full Stack Web Developer. Retired Tech & Gaming Editor.