| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 39 | protected static function boot() |
||
| 40 | { |
||
| 41 | parent::boot(); |
||
| 42 | |||
| 43 | static::addGlobalScope('alphabetical', function (Builder $builder) { |
||
| 44 | $builder->orderBy('name', 'asc'); |
||
| 45 | }); |
||
| 46 | static::updating(function ($instance) { |
||
| 47 | Cache::put('colors.'.$instance->slug, $instance); |
||
| 48 | }); |
||
| 49 | static::deleting(function ($instance) { |
||
| 50 | Cache::delete('colors.'.$instance->slug); |
||
| 51 | }); |
||
| 54 |