| @@ 11-18 (lines=8) @@ | ||
| 8 | { |
|
| 9 | public static function bootRefreshCache() |
|
| 10 | { |
|
| 11 | static::saved(function () { |
|
| 12 | if (auth()->check()) { |
|
| 13 | auth()->user()->load('roles'); |
|
| 14 | } |
|
| 15 | ||
| 16 | app('cache.store')->forget(config('acl.cache.key', 'permissions.policies')); |
|
| 17 | app(GateRegistrar::class)->register(); |
|
| 18 | }); |
|
| 19 | ||
| 20 | static::deleted(function () { |
|
| 21 | if (auth()->check()) { |
|
| @@ 20-27 (lines=8) @@ | ||
| 17 | app(GateRegistrar::class)->register(); |
|
| 18 | }); |
|
| 19 | ||
| 20 | static::deleted(function () { |
|
| 21 | if (auth()->check()) { |
|
| 22 | auth()->user()->load('roles'); |
|
| 23 | } |
|
| 24 | ||
| 25 | app('cache.store')->forget(config('acl.cache.key', 'permissions.policies')); |
|
| 26 | app(GateRegistrar::class)->register(); |
|
| 27 | }); |
|
| 28 | } |
|
| 29 | } |
|
| 30 | ||