$get() field

Did i miss something using the $get function? I have the following fields:
TableRepeater::make()
->schema([
TextInput::make('item_quantity),
TextInput::make('price')
->afterStateUpdated(
fn (callable $get) => dd($get('item_quantity')),)
])
TableRepeater::make()
->schema([
TextInput::make('item_quantity),
TextInput::make('price')
->afterStateUpdated(
fn (callable $get) => dd($get('item_quantity')),)
])
But for some reason the dd returns null while my fields look like the image.
10 Replies
Dennis Koch
Dennis Koch2y ago
Is that a table repeater? Try $get('./item_quantity') or $get('../item_quantity')
Thijmen
ThijmenOP2y ago
It is, but both don't work On a field after the price field i can use $get('item_quantity') so it really doesn't make sense to me why it isn't working
LeandroFerreira
price ->reactive() or ->lazy()
Thijmen
ThijmenOP2y ago
Both fields are reactive
LeandroFerreira
Where is reactive() in the code?
Thijmen
ThijmenOP2y ago
I shortened it
LeandroFerreira
So it should work. Can you share the whole code please?
Thijmen
ThijmenOP2y ago
TextInput::make('item_quantity')
->label('Aantal')
->debounce('300ms')
->numeric()
->required(), TextInput::make('price')
->label('Prijs')
->reactive()
//->disabled()
->afterStateUpdated(fn (callable $get) => dd($get('item_quantity')), ),
TextInput::make('item_quantity')
->label('Aantal')
->debounce('300ms')
->numeric()
->required(), TextInput::make('price')
->label('Prijs')
->reactive()
//->disabled()
->afterStateUpdated(fn (callable $get) => dd($get('item_quantity')), ),
Vp
Vp2y ago
Put reactive() in item_quantity?
Thijmen
ThijmenOP2y ago
Debounce is also reactive But magically it works out of nowhere Don't even now what i changed
Want results from more Discord servers?
Add your server