| Total Complexity | 3 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | trait LaraCache |
||
| 14 | { |
||
| 15 | public static bool $isEnabled = true; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Boot LaraCache |
||
| 19 | * |
||
| 20 | * @throws Exception |
||
| 21 | */ |
||
| 22 | public static function bootLaraCache() |
||
| 23 | { |
||
| 24 | self::observe(LaraCacheObserver::class); |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Get the entities should store in cache |
||
| 29 | * |
||
| 30 | * @return CacheEntity[] |
||
| 31 | */ |
||
| 32 | abstract static public function cacheEntities(): array; |
||
| 33 | |||
| 34 | public static function cache(): Cache |
||
| 37 | } |
||
| 38 | |||
| 39 | public static function laraCache(): Cache |
||
| 44 |