Skip to content

Commit

Permalink
Fix #2674
Browse files Browse the repository at this point in the history
In the case of one to one getRelation returns a model and the pluck call invokes a query instead of invoking pluck on the collection

So instead wrap it to make sure we always get a collection
  • Loading branch information
Tofandel authored and ifox committed Oct 21, 2024
1 parent cb83469 commit bb21695
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Services/Listings/Columns/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected function getRenderValue(TwillModelContract $model): string

/** @var \Illuminate\Database\Eloquent\Collection $relation */
$model->loadMissing($this->relation);
$relation = $model->getRelation($this->relation);
$relation = collect($model->getRelation($this->relation));

return $relation->pluck($this->field)->join(', ');
}
Expand Down

0 comments on commit bb21695

Please sign in to comment.