v1.0.0-beta.4
Pre-release
Pre-release
JosephSilber
released this
01 Sep 01:37
·
324 commits
to master
since this release
New
-
Support Laravel 5.5 π
-
Sync roles (retract any roles not in the list, and assign all roles in the provided list):
Bouncer::sync($user)->roles(['admin', 'reviewer']); // You can also pass in role IDs: Bouncer::sync($user)->roles([1, 2]); // Or role models, if you already have them: Bouncer::sync($user)->roles([$adminModel, $reviewerModel]);
-
Sync abilities (disallow any abilities not in the list, and allow all abilities in the provided list):
Bouncer::sync($user)->abilities(['access-dashboard', 'ban-users']); // You can also pass in ability IDs: Bouncer::sync($user)->abilities([1, 2]); // Or ability models, if you already have them: Bouncer::sync($user)->abilities($abilityModels); // Or a map of abilities: Bouncer::sync($user)->abilities([ 'create' => User::class, 'delete' => Post::class, ]);