FilamentF
Filament14mo ago
BKF Dev

Hide Input Form inside Repeater based on condition

Hello,
I want to hide a select input if the line record exist, (Order has many items), I'm trying this code :
Repeater::make('lines') ->relationship() ->schema([ ... Forms\Components\Select::make('product_id') ->relationship('product', 'name') ->visible(fn(?Model $record) => !$record) ...
But I get this error :
Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization

Is there a way to manage this ? thanks
Was this page helpful?