Zizaco / entrust

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

can check role permission by model ??? #904

Closed atikrahman-ew closed 6 years ago

atikrahman-ew commented 6 years ago

is there any way we can check role permission by model ???????

$user->can(['edit-user', 'create-post']);

Like THat $role->can(['edit-user', 'create-post']); is anything like that possible ???

tkovs commented 6 years ago

Do you want to do this?

$role->can(array('this', 'that'));
atikrahman-ew commented 6 years ago

@tkovs yes wanted to do something like that. but its giving error .... Call to undefined method Illuminate\Database\Query\Builder::can()

atikrahman-ew commented 6 years ago

Solved $role->hasPermission(array('complete-client-form'));