Question and answer is powered by AnsPress.io
I am working on a website and using the Laravel framework for website development. Here I want to update my product quantity using the Laravel update query. If my table column like product_id, current_stock.
So I want to update the current stock by product ID. How can I do it?
If you want to update your product’s current stock using the Laravel update query, apply this code.
<?php $current_stock = $request->current_stock; Products::where('product_id', $request->product_id)->update(array('current_stock' => DB::raw('current_stock + '.$current_stock))); ?>