© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•16mo ago•
5 replies
Rolland

Displaying prefill data in action form select with relationship

Tables\Actions\Action::make('assign_role')
    ->form([
        Forms\Components\Select::make('roles.name')
            ->relationship('roles', 'name')
            ->multiple()
            ->searchable()
            ->preload()
            ->native(false)
            ->required()
    ])
    ->action(function () {
        ...
    })
Tables\Actions\Action::make('assign_role')
    ->form([
        Forms\Components\Select::make('roles.name')
            ->relationship('roles', 'name')
            ->multiple()
            ->searchable()
            ->preload()
            ->native(false)
            ->required()
    ])
    ->action(function () {
        ...
    })


I am wondering if this possible or not.
Solution
You can do

->fillForm(fn($record) => return the data)
->fillForm(fn($record) => return the data)
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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Action modal form with many field to prefill
FilamentFFilament / ❓┊help
3y ago
Form select relationship help
FilamentFFilament / ❓┊help
11mo ago
Form Select relationship with custom search
FilamentFFilament / ❓┊help
11mo ago