As an alternative approach I bind an observer(s) to my models and hook into the events. Not saying it is better, just another way to skin a cat.
It's a good way to separate things.
And about the fact of using an static class as a helper, what do you think?
I rarely using static methods. Whilst they maybe faster they are far less efficient in the eyes of the PHP garbage collector and prone to memory leeks when used unwisely (for example: inside a loop)
It would have no notable impact on your solution I just try to avoid static methods unless they are necessary. Such as the factory pattern.
jacksoncharles said:
I rarely using static methods. Whilst they maybe faster they are far less efficient in the eyes of the PHP garbage collector and prone to memory leeks when used unwisely (for example: inside a loop)
It would have no notable impact on your solution I just try to avoid static methods unless they are necessary. Such as the factory pattern.
I'l follow your advice.
Thanks jacksoncharles!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community