nextdeveloper/iam
nextdeveloper/iam is a Laravel identity and access management package for managing users, roles, permissions, and authentication and authorization workflows. It aims to simplify access control setup, but has limited adoption and sparse documentation, so evaluate fit carefully.
Architecture fit
nextdeveloper/iam targets the Laravel ecosystem directly, so the expected shape is a Composer package with a service provider, publishable config, migrations, and middleware/gate hooks. That is idiomatic for Laravel and keeps the integration surface small: no sidecar, no external identity server, no new runtime.Gate/Policy and Auth abstractions and needs a persistence + admin layer for roles and permissions. Fit is now weakest on the authentication side: adopting the QR badge feature means adopting a home-grown second factor from a package with 3 stars and 0 dependents.laravel/passport or laravel/sanctum. That was true before this release and is more true now: the package has added an authentication-adjacent capability without evidence it has replaced or integrated with the first-party token stacks. Confirm before designing around it.Integration feasibility
composer require + php artisan vendor:publish + migrate flow. The QR badge feature adds migration surface (badge tables, secret/token storage), route registration for admin endpoints, and at least one new consumer-facing verification path. Installation stays under a day; verification does not.v2.0.26 — a patch bump — indicates the project does not follow SemVer for feature delivery. That means the version number carries no reliable signal about what will break, so we cannot triage upgrades by constraint alone; every release must be read.Technical risk
Auth::login(), it will not participate in session regeneration, remember-me, or logout-everywhere, and it may not be picked up by existing middleware.Key questions
composer.json, and is there a CI matrix that actually exercises them?Gate/Policy contracts, or does the package introduce its own check API?users or does it expect to own the user model?Auth::login() session, or a parallel mechanism?Stack fit
| Layer | Assumption | Verification |
|---|---|---|
| Framework | Laravel 10/11/12 | composer.json constraints + CI config |
| PHP | 8.1+ | Same |
| AuthN (primary) | Laravel Auth + Sanctum/Passport (unchanged) |
Confirm no overlap |
| AuthN (secondary) | New: optional QR badge, off by default | Config flag + route registration check |
| AuthZ | Package roles/permissions behind Gate |
Read the service provider bindings |
| Persistence | Own migrations, additive tables | Inspect migration stubs before running |
| Admin surface | Revised: endpoints exist; UI and audit likely absent | Review route definitions and middleware |
The package now spans two layers, and they should be adopted separately, not together. The authorization data layer is a low-regret adoption. The QR authentication feature is a separate decision with a separate risk profile and should not ride in on the same approval. Design the integration so the second is opt-in, not implied by the first.
Migration path
if ($user->is_admin) checks: this is a greenfield authorization model, and the package gives structure cheaply. Straightforward — and stop at the authorization layer for the initial rollout.spatie/laravel-permission: a swap is a data migration, not a code migration. Both packages model roles/permissions similarly on the surface but differ in pivot shape, guard handling, and caching. Expect a backfill script plus a parallel-run period. Do not attempt a cutover without both models live simultaneously behind a feature flag.Compatibility
AuthorizationService) from the first commit. Every call site depends on our interface, never on the vendor namespace. This is the single highest-leverage decision in the whole integration: it makes a later swap to Spatie, Casbin, or an in-house implementation a one-file change, and it caps the vendor risk that the 3-star metric implies.BadgeAuthService with issue, revoke, and verify methods. Application code must never call a vendor badge route or model directly. This is what lets us disable the feature in one line if the threat model turns out to be unacceptable.route:list immediately after install, before deploying anywhere reachable.Sequencing
Gate::allows() honour package permissions? Do policies compose with them? What happens on cache clear? What does a badge payload contain, and what stops a replayed one?AuthorizationService and, only if (b) passed, BadgeAuthService — and implement over the package. No direct vendor references outside the adapters.Maintenance
~2.0 to be safe. Pin to an exact version or commit SHA, diff every upgrade, and require a human read of the changelog before merging. Automating this package's updates is not appropriate.Support
Scaling
Failure modes
| Failure | Impact | Mitigation |
|---|---|---|
| Permission cache stale after role change | User retains revoked access | Explicit invalidation on role mutation; TTL ceiling; test it |
| Badge revocation not enforced on verify | Revoked credential still authenticates; silent account takeover | Verify per-use revocation check in source; require it as a gate for adoption |
| Admin issue/revoke routes exposed unprotected | Credential minting by unauthorised caller | Confirm opt-in registration + middleware before any deploy |
| Badge payload predictable or replayable | Credential forgery | Read the payload construction; require high-entropy server-side secret |
| Package incompatible with Laravel upgrade | Blocks framework upgrade | Adapter layer + fork; test upgrades in CI |
| Maintainer abandons project | No upstream fixes | Internal fork, pinned SHA, named owner |
| Permission mapping gap | Over-permissive or locked-out users | Shadow-mode rollout, deny-by-default, alerting on 403 spikes |
| Authorization check throws | Request fails or, worse, fails open | Fail closed at the adapter; circuit-break to a safe default |
| Cross-tenant predicate missed | Data exposure | Tenant-scoped adapter methods only; no raw package calls |
Ramp-up
How can I help you explore Laravel packages today?