Eloquent Accessors and Mutators (https://laravel.com/docs/5.5/eloquent-mutators) look like the implementation of the Template Method Design Pattern for me (https://sourcemaking.com/design_patterns/template_method)
The abstract model has a bunch of methods, that is called during the entity lifecycle and lets subclasses to decide do they want to change the behaviour or not.
Am I right?
Aucun commentaire:
Enregistrer un commentaire