xxxxxxxxxx
// in a single line here
$values = Cart::where('session_id', $id)->update(['data'=>$data]);
xxxxxxxxxx
// Update records where the condition is met
PatientMail::whereIn('id', [1, 2, 3]) // Array of IDs to update
->update(['status' => 'approved']);
xxxxxxxxxx
// If there's a flight from Oakland to San Diego, set the price to $99.
// If no matching model exists, create one.
$flight = App\Flight::updateOrCreate(
['departure' => 'Oakland', 'destination' => 'San Diego'],
['price' => 99]
);
xxxxxxxxxx
PatientMail::whereIn('status', ['pending', 'review'])
->where('created_at', '<', now()->subDays(30))
->update(['status' => 'approved']);