© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
14 replies
Albert Lens

Select field create new option in modal but using url of existing resource/create - Action in modal

Hello.
I have a select field where user can select from all the created record_types. I have added a button to create a new one (a new record_type) without leaving the form. The problem is that I do not want to use the ->form( because the record_type resource has more that 30 fields.

How can I make this code to execute as it does but in a MODAL?

 Select::make('record_type_id')
                                    ->label(__('record_type'))
                                    ->options(RecordType::all()->pluck('description', 'id'))
                                    ->hintAction(
                                        Action::make('record_type_create')
                                            ->url('/record-types/create')
                                            ->icon('heroicon-m-plus')
                                            ->modalContent()
                                            ->requiresConfirmation()
                                    )
 Select::make('record_type_id')
                                    ->label(__('record_type'))
                                    ->options(RecordType::all()->pluck('description', 'id'))
                                    ->hintAction(
                                        Action::make('record_type_create')
                                            ->url('/record-types/create')
                                            ->icon('heroicon-m-plus')
                                            ->modalContent()
                                            ->requiresConfirmation()
                                    )


It opens the record_type create form, but it is not MODAL. Even if I use ->url('/record-types/create' , true) it opens in a new tab, but it still is NOT A MODAL.

Any idea of how to make it work as a modal??

The idea is, of course, that when creating dossiers, to create a new record_type which is not yet created and therefore not in the select list, be able to create that as modal and REFRESH the list afterwards.

Tks.
image.png
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

Prefilling a Field in "Create New Option" Modal of a Select Component in FilamentPHP**
FilamentFFilament / ❓┊help
3y ago
select field relationship create modal
FilamentFFilament / ❓┊help
3y ago
Open url in modal action
FilamentFFilament / ❓┊help
2y ago
Modal image instead of select option
FilamentFFilament / ❓┊help
2y ago