entrust
entrust copied to clipboard
Add detachRole() into Usage Documentation
I was searching around the Internet to find the detachRole() function. It would be nice if it's documented in the usage section.
Looking at the source for detachRole(), it only requires one argument
public function detachRole($role) { // Just here for an example }
It is the same as Eloquent's detach() method.
From what I can see, you pass in the id of the Role, but you can try the name too.
There is also, detachRoles()
public function detachRoles($roles = null) { // Just here for an example }
And more than likely, this would take an array of the Roles
This should really be in the ReadMe. I did something like this and it worked.
$user = User::find(1);
$user->detachRoles($user->roles);