New
-
Support Laravel 5.4.31, which broke Bouncer.
-
Greatly enhanced granting multiple roles/abilities at once:
// Assign multiple roles: Bouncer::assign(['admin', 'editor'])->to($user); // Allow multiple abilities: Bouncer::allow($user)->to(['access-dashboard', 'ban-users']); // Also works with model abilities: Bouncer::allow($user)->to(['edit', 'delete'], Post::class); Bouncer::allow($user)->to(['edit', 'delete'], $post); // And even with multiple models: Bouncer::allow($user)->to('delete', [Post::class, Category::class]); Bouncer::allow($user)->to(['edit', 'delete'], [Post::class, Category::class]); // Go crazy and pass it an associative array with whatever you want: Bouncer::allow($user)->to([ 'create' => Post::class, 'view' => User::class, 'edit' => $user, ]);
Breaking Changes
- Removed the
isNot
method from theHasRoles
trait. UseisNotA
andisNotAn
instead.