From a9f469b8092c11257f12076c9c3731f22a56383c Mon Sep 17 00:00:00 2001 From: Brett B Date: Thu, 30 Jun 2016 23:32:02 -0400 Subject: [PATCH] Make getConnectionName Overridable Use function call in newFromBuilder instead of class variable to allow for override of getConnectionName function --- src/Illuminate/Database/Eloquent/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index 7e59d7b80fe6..7e5bc0f0a5b6 100755 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -521,7 +521,7 @@ public function newFromBuilder($attributes = [], $connection = null) $model->setRawAttributes((array) $attributes, true); - $model->setConnection($connection ?: $this->connection); + $model->setConnection($connection ?: $this->getConnectionName()); return $model; }