© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
2 replies
shaan

Filamentphp Repeaters

php Repeater::make('items')
                        ->relationship('items')
                        ->schema([
                            Select::make('stock_id')
                                  ->label('Product')
                                  ->searchable()
//                                  ->options(Stock::pluck('product_name', 'id'))
                                  ->options(function () {
                                    return Stock::get()->mapWithKeys(fn($product
                                    ) => [$product->id => "{$product->product_name} (Available: {$product->quantity})"]);
                                })
                                  ->required()
                                  ->reactive(),
                            TextInput::make('quantity_requested')
                                     ->numeric()
                                     ->required(),
                            TextInput::make('quantity_issued')
                                     ->numeric()
                                     ->required()
                                     ->reactive()
                                     ->visible(),
                        ])
                        ->columns(3),
php Repeater::make('items')
                        ->relationship('items')
                        ->schema([
                            Select::make('stock_id')
                                  ->label('Product')
                                  ->searchable()
//                                  ->options(Stock::pluck('product_name', 'id'))
                                  ->options(function () {
                                    return Stock::get()->mapWithKeys(fn($product
                                    ) => [$product->id => "{$product->product_name} (Available: {$product->quantity})"]);
                                })
                                  ->required()
                                  ->reactive(),
                            TextInput::make('quantity_requested')
                                     ->numeric()
                                     ->required(),
                            TextInput::make('quantity_issued')
                                     ->numeric()
                                     ->required()
                                     ->reactive()
                                     ->visible(),
                        ])
                        ->columns(3),
this is my repeater, this is stockrequest_table, so i want to deduct quantity_issued from stock tables quantity and overwrite it. Have tried alot. is it possible with json?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Compact Repeaters
FilamentFFilament / ❓┊help
5mo ago
About Repeaters
FilamentFFilament / ❓┊help
2y ago
filamentphp
FilamentFFilament / ❓┊help
2y ago
Filamentphp Theme
FilamentFFilament / ❓┊help
10mo ago