Section::make()
->schema([
Repeater::make('sections')
->label('Sections')
->relationship()
->schema([
TextInput::make('name')->required(),
TextInput::make('note'),
Section::make()
->schema([
Repeater::make('products')
->label('Products')
->relationship()
->schema([
TextInput::make('name')->required(),
TextInput::make('description'),
TextInput::make('price')->required(),
])
->columns(3)
->collapsible()
->collapsed()
->cloneable()
->itemLabel(fn (array $state): ?string => $state['name'] ?? null),
])
])
->columns(2)
->collapsible()
->collapsed()
->itemLabel(fn (array $state): ?string => $state['name'] ?? null),
])->compact()
Section::make()
->schema([
Repeater::make('sections')
->label('Sections')
->relationship()
->schema([
TextInput::make('name')->required(),
TextInput::make('note'),
Section::make()
->schema([
Repeater::make('products')
->label('Products')
->relationship()
->schema([
TextInput::make('name')->required(),
TextInput::make('description'),
TextInput::make('price')->required(),
])
->columns(3)
->collapsible()
->collapsed()
->cloneable()
->itemLabel(fn (array $state): ?string => $state['name'] ?? null),
])
])
->columns(2)
->collapsible()
->collapsed()
->itemLabel(fn (array $state): ?string => $state['name'] ?? null),
])->compact()