DRYing up code with Eloquent Model Observers

4 Uploads


1 / 4: DRYing up code with Eloquent Model Observers: The problem (1/4)

2 / 4: DRYing up code with Eloquent Model Observers: Solution 1: Mutators (2/4)

3 / 4: DRYing up code with Eloquent Model Observers: Solution 2: Model observer closures (3/4)

4 / 4: DRYing up code with Eloquent Model Observers: Solution 3: Model observer classes (4/4)