Laravel: Define Events in the Model - 2 Ways

preview_player
Показать описание
Interesting showcase of events/listeners usage which I would call non-standard.

Links mentioned in the video:

- - - - -
Support the channel by checking out my products:

- - - - -
Other places to follow:
Рекомендации по теме
Комментарии
Автор

Can you please make a video on php design patterns

mohammadimranmir
Автор

How can I change default timezone for each user?

bulent.sakarya
Автор

Maybe it’s just a personal preference, but I think Laravel controllers should never know about the models, controller should only know the request objects, dispatch some jobs* and delegate the model related operations to service classes, as for the approach seen in this video, it kinda makes the event firing less obvious, specially if you have junior developers in your team.

ikarolaborda
Автор

I would discourage using Events in the Model. They cause a kind of hidden or at least not obvious action. That is a bad idea for long term maintainability.

fordprefect