dejwcake/admin-auth
Admin authentication for Laravel. Adds a dedicated admin guard with login, logout, and password handling, plus middleware to protect admin-only routes. Keeps admin sessions separate from regular user sessions so back-office access stays isolated, simple to configure, and easy to drop into existing a...
Evidence basis: Updated from the 2.1.0 release notes only. No composer.json, source review, or upstream spatie changelog was supplied. The material fact in 2.1.0 is not a code change but a disclosed dependency: this package requires spatie/laravel-permission. That invalidates one conclusion in the prior assessment — "no exotic runtime dependencies" — and means the middleware's locale resolution is plausibly coupled to the authorization subsystem (e.g., role- or permission-derived locale). All conclusions remain provisional until the source and version matrix are read.
Architecture fit: The middleware-plus-service-provider shape is unchanged, and 2.1.0 introduces no code changes to this package. However, the architectural surface is larger than previously understood: a hard dependency on spatie/laravel-permission means adopting this package pulls a second service provider, a permission cache, and (typically) its own migrations and config into the host application. Coupling is no longer "low and reversible" in the strict sense — reversing it now means unwinding two packages. The single-responsibility framing still holds for the locale logic; the dependency is the new architectural weight.
Integration feasibility: Still Composer-installable and still small, but 2.1.0 upgrades the classification from routine patch to coordinated dependency upgrade. The constraint moves spatie/laravel-permission from ^7.4 to ^8.3 — a major-version bump of a security-adjacent authorization package. Critically, the release notes state the breaking surface lands in the host application, not in this package: any app that implements the Role or Permission contracts itself must widen findByName() / findOrCreate() to accept BackedEnum|string. The 2.0.4 enum-handling questions remain entirely unanswered by this release; no fix is claimed.
Technical risk: Moderate — up from low-to-moderate. The risk has migrated from locale semantics to dependency graph.
spatie/laravel-permission is genuinely used in locale resolution (role→locale mapping) or is an over-broad require is unknown. If the middleware performs a permission/role lookup per request, the prior "no I/O, no cache reads" scaling conclusion is wrong. This is the highest-value thing to verify.->value or an int-backed enum now reaches setLocale() and errors. 2.1.0 does not address it.language value is checked against an allowlist.^2.1 pins spatie ^8.3. Teams unable to move to spatie 8 in this cycle must pin below 2.1 and will stop receiving locale fixes — including any future 2.0.4 follow-up on enum handling. Confirm the 2.0.x line remains installable and supported.phpmd.xml .gitattributes removal has no runtime effect.Key questions:
spatie/laravel-permission (role/permission→locale), or is the dependency declared but unused? This determines per-request cost and failure modes.spatie/laravel-permission 8.3, and do they exceed our current minimums?Role / Permission contracts ourselves anywhere (multi-tenancy, custom models, teams)? If yes, the findByName() / findOrCreate() signature change is a required code change on our side.users.language, and whether a regression test exists.setLocale()?Stack fit: Laravel + PHP + Composer, now with spatie/laravel-permission as a required peer. Two service providers, two config surfaces, and a shared cache dependency. Testbench-based testing still implied; no exotic runtime beyond the permission package.
Migration path: No longer a single composer update. Treat 2.1.0 as a two-stage platform change:
spatie/laravel-permission to ^8.3 in its own branch, following the upstream guide; run the authorization test suite and any contract implementations.If the spatie upgrade cannot land this cycle, pin ^2.0 <2.1 deliberately and record the exclusion — do not let Composer resolve silently into a partial state. No migrations or config publishing are introduced by this package itself; the spatie upgrade may introduce both.
Compatibility: The binding constraint is now spatie 8.3's PHP/Laravel floor, not this package's. Determine whether it raises our application's minimum supported PHP or Laravel version — that is a platform decision, not a package decision, and it should be made by whoever owns the runtime baseline. dist archives continue to benefit from .gitattributes trimming (tests/, Docker, QA config excluded); --prefer-source unaffected.
Sequencing:
composer.json for both packages and record the effective PHP/Laravel floor imposed by spatie 8.3.Role / Permission contract implementations; if present, plan the BackedEnum|string signature change before upgrading.Maintenance: Raised from low to moderate. Dependency cadence is now coupled: a change in the permission package can force a release here, and vice versa. Pin explicitly (^2.1 with awareness that it pins spatie ^8.3) and review both changelogs on every release. The 2.0.4 precedent — behavioral change in a patch release — argues against floating constraints. A 3.0 remains plausible around locale resolution semantics; a spatie 9 will now also force a major here.
Support: Both are community OSS with no vendor SLA, and the dependency chain means an upstream spatie issue becomes our issue indirectly. Mitigating factors: spatie is widely deployed and actively maintained, and the locale middleware core remains small enough to fork or reimplement if the dependency proves over-broad. The AGENTS.md / CLAUDE.md additions still read as a positive maintenance signal.
Scaling: Revised upward from negligible. If the middleware consults roles or permissions per request, the hot path now includes a cache read (and potentially a DB query on cache miss) for every request. That is still cheap under normal caching but is not free, and it makes correctness dependent on the permission cache being warm and current. Confirm whether lookups occur in the middleware, and whether the permission cache is shared/redis-backed or per-process. The Octane concern broadens: verify neither locale nor permission state leaks across requests on long-running workers.
Failure modes:
findByName() / findOrCreate() that is not widened to BackedEnum|string becomes a fatal error at upgrade time, not at deploy time.^2.1 requires spatie ^8.3; if another dependency pins spatie ^7, the resolution fails and can block unrelated security patches. Identify that conflict before committing.language is null, absent, or non-string. Still likely, still undetectable without logging. Recommend logging the fall-through.setLocale().Ramp-up: Raised modestly. The locale middleware is still minutes to read; the permission package is not. New adopters now need working knowledge of spatie's role/permission model, its cache behavior, and its upgrade path — a materially larger surface than "one middleware that calls setLocale()". The undocumented policy question from the prior assessment still stands and is now more important: capture our locale resolution precedence (user attribute → role-based mapping → session → Accept-Language → app default) in an ADR, alongside the decision about whether we accept a hard dependency on a permission package to obtain per-user locale.
How can I help you explore Laravel packages today?