Actualy,my scenario is user send request to another user by paying coins,If user doesn't accept the request below 72 hours the coins should be revered to the user,
Im storing coins in coins table.
How can I update records if records are older than 72 hours,I have tried with below code
public function getAllRequests(Request $request)
{
$expired_details = MenterRequest::where('created_at', '<', Carbon::now()->subHours(72)->toDateTimeString())->get();
foreach($expired_details as $expired)
{
$msubIds = $expired->menter_subscriber_id;
$update =Coins::where('user_id','=',$msubIds)->update([
'mcoins','=>','2000001'
]);
}
}
I can get rows older than 72 hour,now how can update them