Description
Elegant, framework-agnostic approach to managing roles and abilities for any app using Eloquent models
Once installed, you can simply tell the bouncer what you want to allow at the gate:
// Give a user the ability to create posts
Bouncer::allow($user)->to('create', Post::class);
// Alternatively, do it through a role
Bouncer::allow('admin')->to('create', Post::class);
Bouncer::assign('admin')->to($user);
// You can also grant an ability only to a specific model
Bouncer::allow($user)->to('edit', $post);
Recent Courses on Laravel Daily
[NEW] Laravel 13 Starter Kit Teams and Customizations
10 lessons
33 min
Testing in Laravel 13 For Beginners
26 lessons
1 h 41 min read
[FREE] Laravel 13 for Beginners: 3 Demo Projects
5 lessons
29 min