© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago
oRieN

Value inside Array not saving when editing

Section::make()
    ->schema([
        Forms\Components\Select::make('type')
            ->required()
            ->disabledOn('edit')
            ->options([
                'web-page' => 'Web Page',
            ])
            ->live()
            ->afterStateUpdated(fn (Select $component) => $component
                ->getContainer()
                ->getComponent('dynamicTypeFields')
                ->getChildComponentContainer()
                ->fill()
            ),

        Grid::make(1)
            ->statePath('content')
            ->schema(fn (Get $get): array => match ($get('type')) {
                'web-page' => [
                    Forms\Components\TextInput::make('url')
                        ->label('URL')
                        ->required()
                        ->disableOn('edit')
                        ->helperText("Note: this type won't provide statistics"),
                ],
                default => [],
            })
            ->key('dynamicTypeFields'),
    ]),
Section::make()
    ->schema([
        Forms\Components\Select::make('type')
            ->required()
            ->disabledOn('edit')
            ->options([
                'web-page' => 'Web Page',
            ])
            ->live()
            ->afterStateUpdated(fn (Select $component) => $component
                ->getContainer()
                ->getComponent('dynamicTypeFields')
                ->getChildComponentContainer()
                ->fill()
            ),

        Grid::make(1)
            ->statePath('content')
            ->schema(fn (Get $get): array => match ($get('type')) {
                'web-page' => [
                    Forms\Components\TextInput::make('url')
                        ->label('URL')
                        ->required()
                        ->disableOn('edit')
                        ->helperText("Note: this type won't provide statistics"),
                ],
                default => [],
            })
            ->key('dynamicTypeFields'),
    ]),


When editing a resource with this fields when I save, the field (web-page) URL goes empty but if i put readonlyOn its fine. The thing is i have other disabledOn('edit') field that still save and dont get empty the webpage URL goes into an json is this a bug or i'm doing something wrong?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Saving related items when editing/creating a resource
FilamentFFilament / ❓┊help
3y ago
select not saving the right value
FilamentFFilament / ❓┊help
3y ago
CheckboxList inside a Fieldset not saving relationship
FilamentFFilament / ❓┊help
13mo ago