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 1212trait Cachable
1313{
1414 protected $ isCachable = true ;
15-
16- protected static $ isCachableKey = 'genealabs:model-caching:is-disabled ' ;
15+ protected static $ isCachableKey = 'genealabs:model-caching:is-disabled ' ;
1716
1817 protected function cache (array $ tags = [])
1918 {
@@ -36,7 +35,7 @@ protected function cache(array $tags = [])
3635
3736 public function disableCache ()
3837 {
39- Cache:: forever (static ::$ isCachableKey , true );
38+ cache ()-> forever (self ::$ isCachableKey , true );
4039
4140 $ this ->isCachable = false ;
4241
@@ -82,9 +81,9 @@ public static function bootCachable()
8281
8382 public static function all ($ columns = ['* ' ])
8483 {
85- if (Cache:: get (static ::$ isCachableKey )) {
84+ if (cache ()-> get (self ::$ isCachableKey )) {
8685 return parent ::all ($ columns );
87- }
86+ }
8887
8988 $ class = get_called_class ();
9089 $ instance = new $ class ;
@@ -99,8 +98,8 @@ public static function all($columns = ['*'])
9998
10099 public function newEloquentBuilder ($ query )
101100 {
102- if (Cache:: get (static ::$ isCachableKey )) {
103- Cache:: forget (static ::$ isCachableKey );
101+ if (cache ()-> get (self ::$ isCachableKey )) {
102+ cache ()-> forget (self ::$ isCachableKey );
104103
105104 return new EloquentBuilder ($ query );
106105 }
You can’t perform that action at this time.
0 commit comments