Answers for "update a pivot table using Eloquent"

PHP
1

update a pivot table using Eloquent

$user = User::find(1);

$user->roles()->updateExistingPivot($roleId, [
    'active' => false,
], false);

//The last param is to not update time updated_at column timestamp.
Posted by: Guest on September-25-2021

Code answers related to "update a pivot table using Eloquent"

Browse Popular Code Answers by Language