sharinganglow
Make hidden repeater
Select::make('type')
->options(Types::getAllTypes())
->live()
->label('Type'),
Repeater::make('first')
->schema([...])
->relationship()
->collapsed()
->collapsible()
->reorderable()
->addActionLabel('Add First Type')
->label('First Type')
->cloneable()
->visible(fn($record) => $record->type === 'first')
->itemLabel(fn(array $state): ?string => $state['name'] ?? null);
Repeater::make('second')
->schema([...])
->relationship()
->collapsed()
->collapsible()
->reorderable()
->addActionLabel('Add Second Type')
->label('Second Type')
->visible(fn($record) => $record->type === 'second')
->itemLabel(fn(array $state): ?string => $state['name'] ?? null);
7 replies