Answers for "how to insert multiple rows in mysql using laravel"

SQL
0

how to insert multiple rows in mysql using laravel

/*
It is really easy to do a bulk insert in Laravel with or without the query builder.
You can use the following official approach.
*/


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']);
Posted by: Guest on December-18-2020

Code answers related to "how to insert multiple rows in mysql using laravel"

Code answers related to "SQL"

Browse Popular Code Answers by Language