-
Notifications
You must be signed in to change notification settings - Fork 216
Sync Roles To User
Kodeine edited this page Feb 23, 2015
·
1 revision
You can pass an array of role objects,ids or slugs to sync them to a user.
$user->syncRoles([1,2,3]);
$user->syncRoles('administrator, moderator');
$user->syncRoles((array($roleAdmin, $roleModerator));
Note: The system will throw an exception if role does not exists.