You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
no errors, but couldn't find details on the database table.
When i look at the model, assignPermission function is not there.could you please let me know why.am i doing anything wrong here?
Thanks
Dami
The text was updated successfully, but these errors were encountered:
DamPe88
changed the title
Assign Permission function cannot be found on Role N=Model
Assign Permission function cannot be found on Role Model
Apr 27, 2017
I have the same problem. I got an error "Method assignPermission does not exist." and I check on the Role class and there isn't a method with that name.
@kodeine The problem was that I was using the method get() instead of first() when instantiating the role and this get you back an array so I changed it to first() and it works great.
eg:
$roleAdmin = Role::where('name', '=', 'Admin')->get(); // here you can't call the method to assign permission
$roleAdmin = Role::where('name', '=', 'Admin')->first(); // I changed to first() and works great
When trying the module on Laravel 5.4 and when allocating permission to the selected Role, assignPermission is not found.following your wiki on this.
no errors, but couldn't find details on the database table.
When i look at the model, assignPermission function is not there.could you please let me know why.am i doing anything wrong here?
Thanks
Dami
The text was updated successfully, but these errors were encountered: