From a39a34fd3b314b2e5eca689ab215109a469aa1e0 Mon Sep 17 00:00:00 2001 From: Aidas Klimas Date: Sun, 20 Oct 2024 21:10:21 +0800 Subject: [PATCH] Update Attributes.php --- packages/admin/src/Support/Forms/Components/Attributes.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/admin/src/Support/Forms/Components/Attributes.php b/packages/admin/src/Support/Forms/Components/Attributes.php index 8df4b49223..e57ad4ee1a 100644 --- a/packages/admin/src/Support/Forms/Components/Attributes.php +++ b/packages/admin/src/Support/Forms/Components/Attributes.php @@ -22,11 +22,10 @@ protected function setUp(): void if (blank($this->childComponents)) { $this->schema(function (\Filament\Forms\Get $get, Livewire $livewire, ?Model $record) { - $modelClass = $livewire::getResource()::getModel(); $productTypeId = null; - $morphMap = $modelClass::morphName(); + $morphMap = $record ? $record::morphName() : $livewire::getResource()::getModel()::morphName(); $attributeQuery = Attribute::where('attribute_type', $morphMap);