I am currently trying to use this method
public function givePermissionTo(Permission $permission)
{
return $this->permissions()->save($permission);
}
So i can assign a permission to a role, for example:
$role->givePermissionTo(Permission::first());
However, what i get when trying to use that method is a bad method call exception.
My attempts to access that method were:
$role = Role::whereName('editor')->skip(1)->take(1)->get();
I have tried it in many other ways, but my problem is that i cannot get an instance of the Role Model, so i can access that method and give it the permission.