File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 12
12
trait Cachable
13
13
{
14
14
protected $ isCachable = true ;
15
-
16
- protected static $ isCachableKey = 'genealabs:model-caching:is-disabled ' ;
15
+ protected static $ isCachableKey = 'genealabs:model-caching:is-disabled ' ;
17
16
18
17
protected function cache (array $ tags = [])
19
18
{
@@ -36,7 +35,7 @@ protected function cache(array $tags = [])
36
35
37
36
public function disableCache ()
38
37
{
39
- Cache:: forever (static ::$ isCachableKey , true );
38
+ cache ()-> forever (self ::$ isCachableKey , true );
40
39
41
40
$ this ->isCachable = false ;
42
41
@@ -82,9 +81,9 @@ public static function bootCachable()
82
81
83
82
public static function all ($ columns = ['* ' ])
84
83
{
85
- if (Cache:: get (static ::$ isCachableKey )) {
84
+ if (cache ()-> get (self ::$ isCachableKey )) {
86
85
return parent ::all ($ columns );
87
- }
86
+ }
88
87
89
88
$ class = get_called_class ();
90
89
$ instance = new $ class ;
@@ -99,8 +98,8 @@ public static function all($columns = ['*'])
99
98
100
99
public function newEloquentBuilder ($ query )
101
100
{
102
- if (Cache:: get (static ::$ isCachableKey )) {
103
- Cache:: forget (static ::$ isCachableKey );
101
+ if (cache ()-> get (self ::$ isCachableKey )) {
102
+ cache ()-> forget (self ::$ isCachableKey );
104
103
105
104
return new EloquentBuilder ($ query );
106
105
}
You can’t perform that action at this time.
0 commit comments