rivalex/clearance
A drop-in Laravel admin panel for spatie/laravel-permission. Manage permissions, roles, guards and settings via Livewire 4 + Flux UI, with contextual authorization, parent-bounded ceiling roles, and optional super admin.
Build vs. buy for the admin/RBAC surface. The roles/permissions/users CRUD screens are some of the most tedious, least differentiating work in a B2B SaaS. This package ships them (dashboard, permissions, roles, guards, settings, per-user assignment) behind one composer require and one artisan installer. That is a defensible "buy" call: it converts a 4–8 week internal admin build into a spike-and-ship decision, and frees the roadmap for product work.
Whether to sell tiered/delegated administration. The fine-grained write permissions (clearance-roles-write vs. clearance-settings-write vs. clearance-users-write) make "customer admin can manage their own people and roles, but not global configuration" a shippable entitlement boundary rather than a bespoke engineering ask. This directly supports pricing-page decisions: self-serve admin seats, delegated customer admins, partner/reseller consoles.
Multi-tenant and per-entity role models. Contextual authorization (canIn(), hasRoleIn(), @canin, ContextService) lets a user hold a role within a Store, Tenant, or Project rather than globally. That unlocks roadmap items that are otherwise expensive: per-location store managers, per-project contributors, per-workspace admins, marketplace seller permissions. The resolve order (contextual grants → global grants → per-context overrides, deny wins) is explicit enough to spec against and to explain to customers/security reviewers.
Governance and role hierarchy requirements from sales/security. "Ceiling roles" (a child role can never exceed its parent's permission set, enforced on every save) is a product feature, not just a technical one — it's what lets you say yes to enterprise questions about privilege escalation, reseller/partner hierarchies, and access-review posture. Similarly, the reserved clearance-* namespace and deny-authoritative overrides give you a credible least-privilege story.
Whether to adopt this as an opt-in internal tool vs. a customer-facing surface. Modules are individually mountable as Livewire components and the Users module is toggleable. That supports a staged decision: internal-only admin tooling first (low risk), customer-facing delegated admin later (higher risk, needs UX/design review and localization — 9 bundled languages already covers initial EU/LatAm/APAC GTM).
Migration/consolidation decisions for existing installs. clearance:backfill plus a documented Spatie-migration path means adopting this on an app that already has roles/permissions is a real option, not a rewrite. That matters if you're deciding whether to standardize authorization admin across several Laravel services.
Sequencing decision: stopgap vs. platform investment. Use this to satisfy admin-tooling demand now and defer a bespoke authorization platform until you actually hit its limits (ABAC, approval workflows, audit trails, cross-service enforcement).
Consider it when:
spatie/laravel-permission. It layers on Spatie rather than replacing it and does not alter Spatie's tables.Look elsewhere — or build — when:
auth.guards at boot is powerful but is a security-sensitive configuration path; if your public auth surface must stay static/config-driven, don't enable that section.Non-negotiables if adopted: keep the super_admin_gate_bypass setting off (default) unless you've explicitly accepted an application-wide Gate bypass; pin the version; and treat the panel as internal-first until it's been exercised in production.
Executive summary (30 seconds). Clearance is a drop-in admin panel for Laravel roles and permissions that would otherwise cost us weeks of undifferentiated engineering. It adds two things we'd have to build ourselves: contextual roles (a user is a manager of a specific store/tenant, not everywhere) and role ceilings (a role can never be granted more than its parent), which are the features that let us sell delegated customer administration and answer enterprise privilege-escalation questions. It's MIT-licensed, installs in one command, and doesn't touch our existing permissions schema. The trade-off is maturity: it's a young, single-maintainer package with no visible community adoption, so we adopt it as a time-boxed, feature-flagged spike, not a permanent platform commitment.
For engineering. composer require rivalex/clearance + php artisan clearance:install handles Spatie setup, migrations, the super_admin role, and the five delegable clearance-*-write permissions; clearance:backfill exists for installs that already have Spatie data. Integration is one trait swap on User (HasClearance supersedes HasRoles, no conflicts). Panel is available at /clearance or as individually mountable Livewire components, using the host app's Livewire layout. Contextual checks are available via canIn(), Blade directives, ContextService, or the Clearance facade — usable from policies and jobs. Test suite is 370 Pest tests / 1054 assertions, which is meaningful but not the same as third-party production mileage.
Proposed pilot (one sprint, clear exit criteria).
super_admin_gate_bypass; do not enable DB-backed guards.Risks and mitigations.
clearance-* protections are the selling point, but they only hold if we leave the global gate bypass off and restrict write permissions deliberately.What success looks like. Weeks of admin CRUD removed from the roadmap; a shippable answer to "can a customer's own admin manage their team?"; and a documented, reversible dependency decision — with a named owner — rather than an unbudgeted piece of infrastructure nobody signed up to maintain.
How can I help you explore Laravel packages today?