From 598c8eabb32478f1565bdd2eac46ff20d698d7f0 Mon Sep 17 00:00:00 2001 From: Ichi Date: Thu, 5 Dec 2024 16:03:41 +0500 Subject: [PATCH] feat: Improved value resolution and preview generation for morph-to relationships --- src/Fields/Relationships/MorphTo.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Fields/Relationships/MorphTo.php b/src/Fields/Relationships/MorphTo.php index 20b963f7d..b31063e9e 100644 --- a/src/Fields/Relationships/MorphTo.php +++ b/src/Fields/Relationships/MorphTo.php @@ -141,9 +141,7 @@ protected function resolvePreview(): string return str($this->types[$item->{$this->getMorphType()}] ?? $item->{$this->getMorphType()}) ->append('(') ->append( - $item - ->{$this->getRelationName()} - ->{$this->getSearchColumn($item->{$this->getRelationName()}::class)} + data_get($item->{$this->getRelationName()}, $this->getSearchColumn($item->{$this->getRelationName()}::class)) ) ->append(')') ->value();