Conditions | 4 |
Paths | 6 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace GeneaLabs\LaravelModelCaching\Traits; |
||
12 | protected function cache(array $tags = []) |
||
13 | { |
||
14 | $cache = cache(); |
||
15 | |||
16 | if (config('laravel-model-caching.store')) { |
||
17 | $cache = $cache->store(config('laravel-model-caching.store')); |
||
18 | } |
||
19 | |||
20 | if (is_subclass_of($cache->getStore(), TaggableStore::class)) { |
||
21 | if (is_a($this, CachedModel::class)) { |
||
22 | array_push($tags, str_slug(get_called_class())); |
||
23 | } |
||
24 | |||
25 | $cache = $cache->tags($tags); |
||
26 | } |
||
27 | |||
28 | return $cache; |
||
29 | } |
||
56 |