Basically, I want to save data in my model, using a condition to prevent multiple stored data from being executed simultaneously.
I am currently doing the following:
$order = Order::find(id); $order->paid_amount = $amount; $order->status = $status; $order->save();
What I need:
$order = Order::find(id); $order->paid_amount = $amount; $order->status = $status; $order->where('last_update', $last_update); $order->save();
Is it possible to do this in laravel efficiently or do I need to use raw sql or update?
source share