updating multiple rows in sql using laravel code example
Example 1: laravel updateorcreate multiple records
$flight = App\Flight::updateOrCreate(
['departure' => 'Oakland', 'destination' => 'San Diego'],
['price' => 99]
);
Example 2: how to insert multiple rows in mysql using laravel
Entity::upsert([
['name' => 'Pierre Yem Mback', 'city' => 'Eseka', 'salary' => 10000000],
['name' => 'Dial rock 360', 'city' => 'Yaounde', 'salary' => 20000000],
['name' => 'Ndibou La Menace', 'city' => 'Dakar', 'salary' => 40000000]
], ['name', 'city'], ['salary']);