laravel model update or create by many code example
Example: update many laravel
$post->comments()->updateMany([
[
'message' => 'A new comment.',
],
[
'message' => 'Another new comment.',
],
]);
$post->comments()->updateMany([
[
'message' => 'A new comment.',
],
[
'message' => 'Another new comment.',
],
]);