Laravel Eloquent roles and abilities.
Added new notA
and notAn
methods, so you can now check for the absence of roles:
Bouncer::is($user)->notA('moderator');
Bouncer::is($user)->notAn('editor');
Also added the isNot
method to the user trait:
$user->isNot('admin');
Fixes:
allow
and disallow
methods. https://github.com/JosephSilber/bouncer/commit/dcfd741d50130495a1d75ade4403f16b38495496
Changed the bouncer's seeding method names. https://github.com/JosephSilber/bouncer/commit/9489bf169ac73a3bb7fca607f34bed295b37ebd2
Bouncer::refresh()
now works for cache drivers with no cache tags. https://github.com/JosephSilber/bouncer/commit/f641451f5213a400740c046774a0437365e2b735
Added seeding.
You can now extend the built-in Ability
& Role
model classes.
After creating your own models, register them with the bouncer:
Bouncer::useAbilityModel(MyAbility::class);
Bouncer::useRoleModel(MyRole::class);
You can also use this to override the default table names; the migrations will use whatever table names you specified in your own models.