yeonjih
update data in other tables
Hello, my problem now is how to fetch from input text. I got an error if I use fn($get)=>get('field_name')
->actions([
Tables\Actions\Action::make('Qty')
->name('Quantity') // ->iconButton() ->form([Forms\Components\TextInput::make('update_qty') ->name('') ->numeric() ->required() ]) ->action(function($record){ Item::where('id',$record->id) ->update([ "item_qty" => //I need to post here ]); })
->name('Quantity') // ->iconButton() ->form([Forms\Components\TextInput::make('update_qty') ->name('') ->numeric() ->required() ]) ->action(function($record){ Item::where('id',$record->id) ->update([ "item_qty" => //I need to post here ]); })
10 replies
update data in other tables
->actions([
Tables\Actions\Action::make('Qty')
->name('Quantity')
// ->iconButton()
->form([Forms\Components\TextInput::make('udpate_qty')
->name('')
->numeric()
])
// ->action(function (array $data): void{
// Item::updated([$data]);
// })
->action(function ($get, $state) {
DB::table('items')
->where('item_code',$get('item_code'))
->update(['item_qty'=> $get('item_qty')+ $state]);
})
->modalWidth('sm')
is this ok to use ?
10 replies