Skip to content

Commit

Permalink
Merge pull request #74 from ajmeireles/add_dont_cache_param
Browse files Browse the repository at this point in the history
[2.x] Pass optional boolean parameter to dontCache()
  • Loading branch information
rennokki authored Jul 16, 2021
2 parents b7b3bef + c7b38a1 commit 3e491d8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Traits/QueryCacheModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,23 +228,25 @@ public function cacheForever()
/**
* Indicate that the query should not be cached.
*
* @param bool $avoidCache
* @return \Illuminate\Database\Query\Builder|static
*/
public function dontCache()
public function dontCache(bool $avoidCache = true)
{
$this->avoidCache = true;
$this->avoidCache = $avoidCache;

return $this;
}

/**
* Alias for dontCache().
*
* @param bool $avoidCache
* @return \Illuminate\Database\Query\Builder|static
*/
public function doNotCache()
public function doNotCache(bool $avoidCache = true)
{
return $this->dontCache();
return $this->dontCache($avoidCache);
}

/**
Expand Down

0 comments on commit 3e491d8

Please sign in to comment.