Zizaco / entrust

Role-based Permissions for Laravel 5
MIT License
6.05k stars 1.29k forks source link

Attach Permission to Multiple Roles Same Time? #946

Open reasecret opened 5 years ago

reasecret commented 5 years ago

Is there any way to attach permission to multiple roles when creating a permission?

`$permission = New Permission;

foreach ($request->roles as $key => $value) { $permission->attachRole($value); }`

I've tried this but giving me error : Call to undefined method App\Permission::attachRole()