From bac111fd00da7d88f61010372698651e3cc3dda4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=2E=20Nagy=20Gerg=C5=91?= Date: Thu, 23 Nov 2023 13:53:44 +0100 Subject: [PATCH] cleanup --- src/Fields/MorphTo.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Fields/MorphTo.php b/src/Fields/MorphTo.php index 2a22868f..0e53a1a9 100644 --- a/src/Fields/MorphTo.php +++ b/src/Fields/MorphTo.php @@ -106,11 +106,9 @@ public function toArray(): array */ public function toInput(Request $request, Model $model): array { - $relation = $this->getRelation($model); - return array_merge(parent::toInput($request, $model), [ 'url' => $this->replaceRoutePlaceholders($request->route()), - 'morphTypeName' => $name = $relation->getMorphType(), + 'morphTypeName' => $name = $this->getRelation($model)->getMorphType(), 'morphType' => $model->getAttribute($name), ]); }