Answers for "laravel eloquent update many to many"

PHP
0

laravel many to many relation update

$user->roles()->sync([1, 2, 3]);
Posted by: Guest on May-08-2021
1

update many laravel

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

Code answers related to "laravel eloquent update many to many"

Browse Popular Code Answers by Language