smorken/roles
A Laravel package for role-based access control. Assign roles and permissions to users, guard routes with middleware, and check abilities in Blade or application code. Simple configuration and caching make authorization quick to set up and maintain.
admin vs member, gated routes, conditional navigation, hidden admin panels — without committing to a permissions platform. The decision it informs is: do we ship coarse access control this sprint, or does the roadmap absorb a multi-week authz design?spatie/laravel-permission." The package's only advantage is that initial day; its costs are maintenance ownership and Bitbucket supply-chain friction (VCS repo entry, credential management, a single maintainer who can delete the repo).Consider it when:
AccessControl interface, with a pre-agreed migration to native Gates, Policies, or spatie/laravel-permission if requirements grow.Look elsewhere when:
spatie/laravel-permission are the mature answers.Recommendation framing: treat this as a candidate for a short, time-boxed spike against your real Laravel version — not an adoption decision. If the spike passes, ship it behind an abstraction layer with the replacement path agreed up front. If it takes more than a day or two to get running, the build-vs-adopt math flips: writing a roles trait in-house is roughly a day of work and produces an asset you own outright.
For executives — the one-paragraph version: Authorization is on our roadmap regardless of vendor: users need to see different things depending on who they are. This package is a thin, low-cost helper that would let us ship the simple version — a few named roles, gated screens — in days instead of weeks, pulling role-dependent features earlier in the roadmap. It is not a platform bet and it should not shape how we model customers, teams, or permissions. It carries essentially no community traction — no stars, no dependents, a single maintainer on a private-hosted repo — so we should treat it as temporary scaffolding with a known replacement path rather than a long-term dependency. The recommendation is a small, time-boxed evaluation: the downside is measured in days, the upside is unblocking gated features now, and we would isolate it so a future swap costs one interface, not a rewrite.
For engineering — the practical summary:
Expect a HasRoles-style trait on the user model, a Role model and pivot, route middleware, and Blade helpers. Small, readable footprint — which cuts both ways: easy to adopt, easy to outgrow. It is a roles helper, not a permissions system; do not assume abilities, teams, guards, or policy integration are handled. Adoption means a vcs Composer entry pointed at Bitbucket, which means credential management in CI and every dev environment, or a mirrored fork — so plan to mirror, tag 1.0.0-internal, and publish from a private registry instead. Before any code changes, build a characterization suite around the public surface: role assign, role remove, positive check, negative check, middleware pass, and — most importantly — middleware deny, since a regression in a deny path grants access rather than blocking it. Wrap it in a single internal AccessControl contract; no direct trait calls in controllers. Open questions to answer in the spike: supported Laravel/PHP matrix, migration footprint versus existing roles/role_user tables, cache invalidation on role writes, license compatibility, and whether it integrates with or sits orthogonal to Laravel's Gate/Policy system. Budget one to two days to evaluate and integrate. Beyond that, build it ourselves.
How can I help you explore Laravel packages today?