Skip to content

Commit 06f3145

Browse files
committed
Introduction of dontCache Bool Param
1 parent 2d64b53 commit 06f3145

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Traits/QueryCacheModule.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,24 +227,26 @@ public function cacheForever()
227227

228228
/**
229229
* Indicate that the query should not be cached.
230-
*
230+
*
231+
* @param bool $avoidCache
231232
* @return \Illuminate\Database\Query\Builder|static
232233
*/
233-
public function dontCache()
234+
public function dontCache(bool $avoidCache = true)
234235
{
235-
$this->avoidCache = true;
236+
$this->avoidCache = $avoidCache;
236237

237238
return $this;
238239
}
239240

240241
/**
241242
* Alias for dontCache().
242243
*
244+
* @param bool $avoidCache
243245
* @return \Illuminate\Database\Query\Builder|static
244246
*/
245-
public function doNotCache()
247+
public function doNotCache(bool $avoidCache = true)
246248
{
247-
return $this->dontCache();
249+
return $this->dontCache($avoidCache);
248250
}
249251

250252
/**

0 commit comments

Comments
 (0)