FilamentF
Filament15mo ago
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 () {
        ...
    })


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

->fillForm(fn($record) => return the data)
Was this page helpful?