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
3 Replies
Vp
Vp2mo ago
BKF Dev
BKF DevOP2mo ago
Already set it, but the problem is when repeater is empty, otherwise it works fine if items already exist
Vp
Vp2mo ago
Not really understand what you meant, but you could also check like if repeater not empty or smth
Want results from more Discord servers?
Add your server