File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/Filament/RelationManagers Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -160,10 +160,13 @@ public function table(Table $table): Table
160160 Tables \Actions \EditAction::make ()
161161 ->slideOver ()
162162 ->mutateRecordDataUsing (function (array $ data ) {
163+
164+ $ key = $ this ->ownerRecord ->getKeyName () ?? 'id ' ;
165+
163166 return [
164167 ...$ data ,
165168 'model_type ' => 'setting ' ,
166- 'model_key ' => $ this ->ownerRecord ->ulid ,
169+ 'model_key ' => $ this ->ownerRecord ->{ $ key } ,
167170 ];
168171 })
169172 ->after (function (Component $ livewire ) {
@@ -177,8 +180,10 @@ public function table(Table $table): Table
177180 ->hasColumn ($ this ->ownerRecord ->getTable (), $ record ->valueColumn )
178181 ) {
179182
183+ $ key = $ this ->ownerRecord ->getKeyName () ?? 'id ' ;
184+
180185 $ this ->ownerRecord ->update ([
181- $ record ->valueColumn => collect ($ this ->ownerRecord ->{$ record ->valueColumn })->forget ($ record ->ulid )->toArray (),
186+ $ record ->valueColumn => collect ($ this ->ownerRecord ->{$ record ->valueColumn })->forget ($ record ->{ $ key } )->toArray (),
182187 ]);
183188 }
184189
You can’t perform that action at this time.
0 commit comments