Skip to content

Commit

Permalink
Use app() instead of $this->app.
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Apr 2, 2020
1 parent 0466751 commit aa76a89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Database/CachableQueryServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ class CachableQueryServiceProvider extends ServiceProvider
public function register()
{
QueryBuilder::macro('remember', function ($duration, $key = null) {
return (new CacheDecorator($this, $this->app->make('cache.store')))->remember($duration, $key);
return (new CacheDecorator($this, \app('cache.store')))->remember($duration, $key);
});

QueryBuilder::macro('rememberForever', function ($key = null) {
return (new CacheDecorator($this, $this->app->make('cache.store')))->rememberForever($key);
return (new CacheDecorator($this, \app('cache.store')))->rememberForever($key);
});

EloquentBuilder::macro('remember', function ($duration, $key = null) {
return (new CacheDecorator($this, $this->app->make('cache.store')))->remember($duration, $key);
return (new CacheDecorator($this, \app('cache.store')))->remember($duration, $key);
});

EloquentBuilder::macro('rememberForever', function ($key = null) {
return (new CacheDecorator($this, $this->app->make('cache.store')))->rememberForever($key);
return (new CacheDecorator($this, \app('cache.store')))->rememberForever($key);
});
}
}

0 comments on commit aa76a89

Please sign in to comment.