From 7b658421b1522ed1f3f45a219b84bbe4c9e1544e Mon Sep 17 00:00:00 2001 From: Jack Wilkinson <31214002+jaxwilko@users.noreply.github.com> Date: Wed, 3 Jun 2026 12:01:52 +0100 Subject: [PATCH] Added fix to move pluck to the query rather than the collection --- src/Database/Relations/HasMany.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Database/Relations/HasMany.php b/src/Database/Relations/HasMany.php index 1af5923ca..b91c03724 100644 --- a/src/Database/Relations/HasMany.php +++ b/src/Database/Relations/HasMany.php @@ -85,8 +85,8 @@ public function getSimpleValue() $value = null; $relationName = $this->relationName; - if ($relation = $this->parent->$relationName) { - $value = $relation->pluck($this->localKey)->all(); + if ($relation = $this->parent->$relationName()->pluck($this->localKey)) { + $value = $relation->all(); } return $value;