Skip to content

Commit 2502c32

Browse files
committed
fix
1 parent e7f061b commit 2502c32

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Fields/Meta.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ public function getValue(Model $model): mixed
9999
&& $model->relationLoaded('metaData')
100100
&& ! $model->relationLoaded($name)
101101
) {
102-
$model->setRelation($name, $model->metaValue($this->getModelAttribute()));
102+
$model->setRelation(
103+
$name,
104+
$model->metaData->sortByDesc('created_at')->firstWhere('key', $this->getModelAttribute())
105+
);
103106
}
104107

105108
return parent::getValue($model);

0 commit comments

Comments
 (0)