F
Filamentβ€’2mo ago
Rolland

Repeater with existing data

Forms\Components\Section::make('Request Items')
->schema([
Forms\Components\Repeater::make('requestHasItems')
->relationship()
->schema([
Forms\Components\Select::make('item_id')
->relationship('item', 'name')
->searchable()
->native(false)
->preload()
->required(),
Forms\Components\TextInput::make('quantity')
->numeric()
->default(1)
->required(),
])
->columns(2),
]),
Forms\Components\Section::make('Request Items')
->schema([
Forms\Components\Repeater::make('requestHasItems')
->relationship()
->schema([
Forms\Components\Select::make('item_id')
->relationship('item', 'name')
->searchable()
->native(false)
->preload()
->required(),
Forms\Components\TextInput::make('quantity')
->numeric()
->default(1)
->required(),
])
->columns(2),
]),
I have this repeater to add items to a request. I can add the items to the request_has_items table, but I don't know how to display them in the repeater. I kindly need some guidance.
Solution:
nvm, the code i have suddenly working. πŸ˜…
Jump to solution
1 Reply
Solution
Rolland
Rollandβ€’2mo ago
nvm, the code i have suddenly working. πŸ˜…
Want results from more Discord servers?
Add your server