We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7f061b commit 2502c32Copy full SHA for 2502c32
src/Fields/Meta.php
@@ -99,7 +99,10 @@ public function getValue(Model $model): mixed
99
&& $model->relationLoaded('metaData')
100
&& ! $model->relationLoaded($name)
101
) {
102
- $model->setRelation($name, $model->metaValue($this->getModelAttribute()));
+ $model->setRelation(
103
+ $name,
104
+ $model->metaData->sortByDesc('created_at')->firstWhere('key', $this->getModelAttribute())
105
+ );
106
}
107
108
return parent::getValue($model);
0 commit comments