Using query builder on Hint or helperText
Is there a way to display query on Hint or heloperText. I want to display the available quantity when i select the item. Or is there another way to do it .
:
Forms\Components\Select::make('item_id')
->options(Item::query()->pluck('item_name', 'id'))
->reactive()
->afterStateUpdated(fn(callable $set) => $set('quantity', null))
->required(),
Forms\Components\TextInput::make('quantity')
->helperText(fn(callable $get)=>MainStock::query()->pluck('quantity')->whereIn('item_id',$get('item_id')))
2 Replies