FilamentF
Filamentโ€ข15mo 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),
                    ]),


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. ๐Ÿ˜…
Was this page helpful?