silber/bouncer
Roles and abilities for Laravel with a clean, expressive API. Bouncer manages user authorization, supports Eloquent models, caching, gates and policies, and fluent assignment/checks like can() and is(). Great for flexible, database-driven permissions.
can('edit', Post::class)), aligning well with Laravel’s native authorization patterns. The ability to mix roles and direct abilities (e.g., allow($user)->to('publish', Article::class)) makes it versatile for complex permission models.Bouncer::scope()->onceTo($tenantId, ...)) reduces boilerplate for tenant-isolated permissions.can('update', Post::class, $post)) simplifies resource-specific access control.entity_id/entity_type for allowEveryone()).Bouncer::refresh() post-upgrade.Auth::user()) may complicate custom auth setups (e.g., API tokens).Bouncer::runAfterPolicies() to validate behavior.Bouncer::scope()->onceTo().entity_type values stored as raw class names? If yes, plan for the morph map migration.allowEveryone(): Are entity_id/entity_type nullable in the permissions table? If not, update the schema.Bouncer::refresh() post-upgrade to clear stale data.HasAbilities/Authorizable traits for model-based permissions.Gate facade with can(), canAny(), etc.authorize() middleware or policy methods.Bouncer\Events\AbilityAdded, RoleAssigned, etc.entity_id/entity_type (if using allowEveryone()).php artisan vendor:publish --provider="Bouncer\BouncerServiceProvider").entity_type values to morph map classes if needed.allowEveryone(): Alter permissions table to make entity_id/entity_type nullable.getClipboardInstance() calls (removed in v1.0.0-rc.7).Bouncer::runAfterPolicies()).Levels logic with roles/abilities if needed.allow(), revoke()).Bouncer::allow() vs. policy deny()).Bouncer::refresh().Gate::define('edit-post', ...) → Bouncer::allow($user)->to('edit', Post::class)).composer.json to avoid auto-updates during minor releases.composer why-not to audit dependency conflicts.roles, abilities, `How can I help you explore Laravel packages today?