© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Veur

CreateOptionForm is not showing

I have a working form that contains a select field to set a user's
city_id
city_id
. I'm trying to add a createOptionForm, but the modal won't show up (but there is network activity, see video).

I'm on the latest Filament version, and the form is loaded in a custom Livewire component (outside a Panel).

This is the code of the form:

protected function form(Form $form): Form
    {
        return $form
            ->schema([
                Select::make('city_id')
                    ->label('Select city')
                    ->relationship('city', 'name')
                    ->preload()
                    ->required()
                    ->createOptionForm([
                        TextInput::make('name')
                            ->label('City')
                            ->required(),
                    ]),
            ])
            ->model($this->user);
    }
protected function form(Form $form): Form
    {
        return $form
            ->schema([
                Select::make('city_id')
                    ->label('Select city')
                    ->relationship('city', 'name')
                    ->preload()
                    ->required()
                    ->createOptionForm([
                        TextInput::make('name')
                            ->label('City')
                            ->required(),
                    ]),
            ])
            ->model($this->user);
    }


And the relationship in the User model:

    public function city()
    {
        return $this->belongsTo(City::class);
    }
    public function city()
    {
        return $this->belongsTo(City::class);
    }


BTW: the form is loaded in a https://wire-elements.dev/pro SlideOver from @Philo
Solution
Did you add
<x-filament-actions::modals />
<x-filament-actions::modals />
?
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

CreateOptionForm is not showing
FilamentFFilament / ❓┊help
3y ago
slug is not generated within createOptionForm
FilamentFFilament / ❓┊help
2y ago
createOptionForm is not saving the created record
FilamentFFilament / ❓┊help
3y ago
createOptionForm not checking policys
FilamentFFilament / ❓┊help
2y ago