update many to many laravel example laravel 8
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.',
],
]);