Releases: ajimoti/roles-and-permissions
Releases · ajimoti/roles-and-permissions
1.1.2
1.1.1
Support for magic calls
For example:
After a model has been assigned a role, we shouldn't have to always use the ->hasRole() method to check if the user has a specific role. Or the holds() method to check if the model holds a permission. Developers should be able to prepend is with the role key and make a call on the model like so:
// $model->is{role_key}()
$model->isSuperAdmin(); // returns bool
// Or on a many-to-many relationship
$user->of($model)->isSuperAdmin();Similarly, perpend can with the permission to check if the model has permission:
// $model->can{permission_key}()
$model->canDeleteTransactions(); // returns bool
// Or on a many-to-many relationship
$user->of($model)->canDeleteTransactions();What's Changed
New Contributors
Full Changelog: 1.0.0...1.1.0