@@ -374,12 +374,14 @@ class MyCustomBuilder implements QueryCacheModuleInterface
374374Since all of the Laravel Eloquent functions are based on it, the builder that comes with this package replaces only the ` get() ` one:
375375
376376``` php
377+ use Illuminate\Support\Arr;
378+
377379class Builder
378380{
379381 public function get($columns = ['*'])
380382 {
381383 if (! $this->shouldAvoidCache()) {
382- return $this->getFromQueryCache('get', $columns);
384+ return $this->getFromQueryCache('get', Arr::wrap( $columns) );
383385 }
384386
385387 return parent::get($columns);
@@ -413,6 +415,8 @@ The default behaviour of the package doesn't use it, since the query builder use
413415However, if your builder replaces functions like ` find() ` , ` $id ` is needed and you will also have to replace the ` getQueryCacheCallback() ` like so:
414416
415417``` php
418+ use Illuminate\Support\Arr;
419+
416420class MyCustomBuilder
417421{
418422 public function getQueryCacheCallback(string $method = 'get', $columns = ['*'], string $id = null)
@@ -434,7 +438,7 @@ class MyCustomBuilder
434438 {
435439 // implementing the same logic
436440 if (! $this->shouldAvoidCache()) {
437- return $this->getFromQueryCache('find', $columns, $id);
441+ return $this->getFromQueryCache('find', Arr::wrap( $columns) , $id);
438442 }
439443
440444 return parent::find($id, $columns);
0 commit comments