© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
Hasnayeen

How to customize data before saving when creating a new option in a modal

When creating a new option via modal, how to customize the data before saving.
    Forms\Components\Select::make('tag_id')
        ->relationship('tag', 'name')
        ->createOptionForm([
            Forms\Components\TextInput::make('name')
                ->required()
                ->reactive()
                ->afterStateUpdated(fn (Set $set, ?string $state) => $set('slug', Str::slug($state)))
                ->maxLength(255),
            Forms\Components\TextInput::make('slug')
                ->required()
                ->maxLength(255),
        ])
        ->required(),
    Forms\Components\Select::make('tag_id')
        ->relationship('tag', 'name')
        ->createOptionForm([
            Forms\Components\TextInput::make('name')
                ->required()
                ->reactive()
                ->afterStateUpdated(fn (Set $set, ?string $state) => $set('slug', Str::slug($state)))
                ->maxLength(255),
            Forms\Components\TextInput::make('slug')
                ->required()
                ->maxLength(255),
        ])
        ->required(),

Need to add
user_id
user_id
to the tag, and there is no
TagResource
TagResource
so no way to customize in CreateTag page, is there any other way to do it?
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

creating records. How customize before saving
FilamentFFilament / ❓┊help
2y ago
How to modify data before saving in simple modal.
FilamentFFilament / ❓┊help
3y ago
Confirm modal before saving form
FilamentFFilament / ❓┊help
3y ago
Customizing data before saving
FilamentFFilament / ❓┊help
3y ago