From 890fd9c3ba5523f5b5168efb4ed4f7849e1b5a13 Mon Sep 17 00:00:00 2001 From: Carl Saggs Date: Thu, 28 Oct 2021 14:07:45 +0100 Subject: [PATCH] Allow direct access to `initJoins` (#21) --- src/Relations/HasManyViaMany.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Relations/HasManyViaMany.php b/src/Relations/HasManyViaMany.php index 09c38a1..990fb15 100644 --- a/src/Relations/HasManyViaMany.php +++ b/src/Relations/HasManyViaMany.php @@ -223,7 +223,7 @@ public function getResults() * Handle predefined joins array * @return void */ - protected function initJoins() + public function initJoins() { // Store existing joins and clear list $joins = !empty($this->query->getQuery()->joins) ? $this->query->getQuery()->joins : []; @@ -243,6 +243,8 @@ protected function initJoins() // Re-add existing joins to the end (we need to ensure relation joins run first) $this->query->getQuery()->joins = array_merge($this->query->getQuery()->joins, $joins); + + return $this; } /**