Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace GeneaLabs\LaravelModelCaching; |
||
19 | public static function boot() |
||
20 | { |
||
21 | parent::boot(); |
||
22 | $class = get_called_class(); |
||
23 | $instance = new $class; |
||
24 | |||
25 | static::created(function () use ($instance) { |
||
26 | $instance->flushCache(); |
||
27 | }); |
||
28 | |||
29 | static::deleted(function () use ($instance) { |
||
30 | $instance->flushCache(); |
||
31 | }); |
||
32 | |||
33 | static::saved(function () use ($instance) { |
||
34 | $instance->flushCache(); |
||
35 | }); |
||
36 | |||
37 | static::updated(function () use ($instance) { |
||
38 | $instance->flushCache(); |
||
39 | }); |
||
59 |