From 6a7a78d47d0b525603ee469983e2f3cc6580c7fd Mon Sep 17 00:00:00 2001 From: Edex Date: Tue, 29 Oct 2024 22:27:37 +0200 Subject: [PATCH] Fix for one to one relation column in index table --- src/Services/Listings/Columns/Relation.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Services/Listings/Columns/Relation.php b/src/Services/Listings/Columns/Relation.php index 9c6c05ec7..cf6e7769e 100644 --- a/src/Services/Listings/Columns/Relation.php +++ b/src/Services/Listings/Columns/Relation.php @@ -46,7 +46,8 @@ protected function getRenderValue(TwillModelContract $model): string /** @var \Illuminate\Database\Eloquent\Collection $relation */ $model->loadMissing($this->relation); - $relation = collect($model->getRelation($this->relation)); + $relation = $model->getRelation($this->relation); + if(!$relation instanceof \Illuminate\Database\Eloquent\Collection) $relation = collect([$relation]); return $relation->pluck($this->field)->join(', '); }