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),
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?
Was this page helpful?