Laravel Updateorcreate Multiple Records

[Solved] Laravel Updateorcreate Multiple Records | Php - Code Explorer | yomemimo.com
Question : laravel eloquent update multiple records

Answered by : waqas-ahmed

// in a single line here
$values = Cart::where('session_id', $id)->update(['data'=>$data]);

Source : | Last Update : Fri, 03 Sep 21

Question : laravel updateorcreate multiple records

Answered by : fragile-fish-2yrot00fv0m2

// 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]
);

Source : https://stackoverflow.com/questions/27106825/using-updateorcreate-for-multiple-data-insert-in-laravel | Last Update : Fri, 10 Apr 20

Answers related to laravel updateorcreate multiple records

Code Explorer Popular Question For Php