FilamentF
Filament3y ago
1 reply
mar5hall

How can i save array keys after modify?

If i dump method mutateFormDataBeforeFill i get array what i needed (see first dump screen). But if i dump mutateFormDataBeforeSave original array keys is missing(see second dump screen). I use repeater in form to modify that data:
Repeater::make('properties')
                    ->label('Страницы')
                    ->schema([
                        /// Inputs here
                    ])
                    ->columns(1)
                    ->itemLabel(fn(array $state): ?string => $state['label'] ?? null)
                    ->columnSpanFull()
                    ->collapsed()
                    ->reorderable(false)
                    ->deletable(false)
                    ->addable(false),


How can i save original array keys?
image.png
image.png
Was this page helpful?