Answers for "php laravel update many records"

PHP
-1

laravel eloquent update multiple records

// in a single line here
$values = Cart::where('session_id', $id)->update(['data'=>$data]);
Posted by: Guest on August-27-2021
1

update many laravel

$post->comments()->updateMany([
    [
        'message' => 'A new comment.',
    ],
    [
        'message' => 'Another new comment.',
    ],
]);
Posted by: Guest on December-18-2020

Browse Popular Code Answers by Language