File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public function handle()
21
21
22
22
protected function flushEntireCache () : int
23
23
{
24
- cache ( )
24
+ app ( ' cache ' )
25
25
->store (config ('laravel-model-caching.store ' ))
26
26
->flush ();
27
27
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ trait Caching
13
13
14
14
public function cache (array $ tags = [])
15
15
{
16
- $ cache = cache ( );
16
+ $ cache = app ( ' cache ' );
17
17
18
18
if (config ('laravel-model-caching.store ' )) {
19
19
$ cache = $ cache ->store (config ('laravel-model-caching.store ' ));
@@ -70,7 +70,7 @@ protected function makeCacheKey(
70
70
) : string {
71
71
$ eagerLoad = $ this ->eagerLoad ?? [];
72
72
$ model = $ this ->model ?? $ this ;
73
- $ query = $ this ->query ?? app (Builder::class );
73
+ $ query = $ this ->query ?? app (' db ' )-> query ( );
74
74
75
75
return (new CacheKey ($ eagerLoad , $ model , $ query ))
76
76
->make ($ columns , $ idColumn , $ keyDifferentiator );
@@ -80,7 +80,7 @@ protected function makeCacheTags() : array
80
80
{
81
81
$ eagerLoad = $ this ->eagerLoad ?? [];
82
82
$ model = $ this ->model ?? $ this ;
83
- $ query = $ this ->query ?? app (Builder::class );
83
+ $ query = $ this ->query ?? app (' db ' )-> query ( );
84
84
85
85
$ tags = (new CacheTags ($ eagerLoad , $ model , $ query ))
86
86
->make ();
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ trait CreatesApplication
14
14
15
15
protected function cache ()
16
16
{
17
- $ cache = cache ( );
17
+ $ cache = app ( ' cache ' );
18
18
19
19
if (config ('laravel-model-caching.store ' )) {
20
20
$ cache = $ cache ->store (config ('laravel-model-caching.store ' ));
@@ -33,7 +33,7 @@ public function setUp()
33
33
$ this ->loadMigrationsFrom (__DIR__ . '/database/migrations ' );
34
34
view ()->addLocation (__DIR__ . '/resources/views ' , 'laravel-model-caching ' );
35
35
36
- $ this ->cache = cache ( )
36
+ $ this ->cache = app ( ' cache ' )
37
37
->store (config ('laravel-model-caching.store ' ));
38
38
39
39
$ this ->cache ()->flush ();
Original file line number Diff line number Diff line change @@ -29,10 +29,10 @@ public function testSpecifyingAlternateCacheDriver()
29
29
30
30
$ authors = (new Author )
31
31
->all ();
32
- $ defaultcacheResults = cache ( )
32
+ $ defaultcacheResults = app ( ' cache ' )
33
33
->tags ($ tags )
34
34
->get ($ key )['value ' ];
35
- $ customCacheResults = cache ( )
35
+ $ customCacheResults = app ( ' cache ' )
36
36
->store ('customCache ' )
37
37
->tags ($ tags )
38
38
->get ($ key )['value ' ];
You can’t perform that action at this time.
0 commit comments