Skip to content

Commit 7141d1f

Browse files
committed
Allow using custom builders on models
Use original model newEloquentBuilder to retrieve the builder used for a model. This allows using custom builders on models, defining them with UseEloquentBuilder attribute or $builder static property
1 parent 3563993 commit 7141d1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Traits/ModelCaching.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function newEloquentBuilder($query)
111111
if (! $this->isCachable()) {
112112
$this->isCachable = false;
113113

114-
return new EloquentBuilder($query);
114+
return parent::newEloquentBuilder($query);
115115
}
116116

117117
return new CachedBuilder($query);

0 commit comments

Comments
 (0)