jeudi 1 février 2018

How to pass multiple updates to different records in Laravel?

Laravel allows to insert multiple rows passing as array of array rows to be inserted

https://laravel.com/docs/5.5/queries#inserts

DB::table('users')->insert([
    ['email' => 'taylor@example.com', 'votes' => 0],
    ['email' => 'dayle@example.com', 'votes' => 0] 
]);

Is there any alternative to do the same with update?

DB::table('users')->update[
    [update to record 1],
    [update to record 2]
];



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2Evlezx
via IFTTT

Aucun commentaire:

Enregistrer un commentaire