From 7141d1f57997306cdf9086270424489a9509baa6 Mon Sep 17 00:00:00 2001 From: akyrey Date: Fri, 24 Oct 2025 12:27:46 +0200 Subject: [PATCH] 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 --- src/Traits/ModelCaching.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Traits/ModelCaching.php b/src/Traits/ModelCaching.php index b18927d..4359cca 100644 --- a/src/Traits/ModelCaching.php +++ b/src/Traits/ModelCaching.php @@ -111,7 +111,7 @@ public function newEloquentBuilder($query) if (! $this->isCachable()) { $this->isCachable = false; - return new EloquentBuilder($query); + return parent::newEloquentBuilder($query); } return new CachedBuilder($query);