FilamentF
Filament6mo ago
Søren

$record in action closure in Infolist RepeatableEntry references parent model

RepeatableEntry::make('bidders')
    ->schema([
        TextEntry::make('document.id')
            ->suffixActions([
                Action::make('detach')
                    ->action(fn (Bidder $record) => $record->document()->disassociate()->saveOrFail()),
            ]),
        ]),


In Filament 3 - the $record here would be the model that is being repeated/iterated (in this case, a Bidder model). But in Filament 4 it's passing in the $record of the resource being viewed.

Is this an intended change?
Was this page helpful?