wnikk/laravel-access-rules
wnikk/laravel-access-rules adds flexible rule-based access control to Laravel. Define permissions for routes, models, and UI elements, then enforce them with middleware, gates, and Blade directives. Lightweight configuration keeps authorization clear and maintainable.
What this release tells us about the package. v3.3.15 is a hardening patch for a Laravel package that stores rules in a self-referential hierarchy (parent_id adjacency list), with an Artisan command surface (acr:doctor) for integrity inspection. Two changes: a write-path invariant ("a rule cannot be placed under itself") and a diagnostic that finds rules whose parent row is missing or whose parent chain forms a loop.
Architecture fit. The package follows idiomatic Laravel conventions — service provider, Artisan command, Eloquent-backed adjacency list. That is a low-friction fit for our stack and needs no new infrastructure. The architectural caveat is the data model itself: adjacency lists require recursive traversal to resolve ancestry, which is fine at hundreds of rules and painful at tens of thousands. Nothing in these notes changes that, but the existence of a chain-walking doctor confirms ancestry resolution is a real runtime concern.
Integration feasibility. Patch-level version bump with no stated config or migration changes, so integration cost is near zero. The doctor command is the valuable part: it gives us a read-only pre-flight check we can run before enabling the new write guard in production, which de-risks the rollout considerably.
Technical risk.
--fix, exit codes, and scoping to tenants are all unconfirmed.Key questions for the maintainer.
acr:doctor repair anything, or is it strictly read-only? Are exit codes non-zero on findings (schedulable/alertable)?Stack fit. Standard Laravel Artisan command — runs in local, CI, and the Laravel scheduler with no new runtime dependency, queue worker, or external service. Zero infrastructure delta.
Migration path. Treat as a routine patch upgrade (^3.3.15) in a normal maintenance window with a DB snapshot taken first. Confirm from composer.json / CHANGELOG that no migrations or config publishes were shipped; the release notes don't mention any, which is not the same as none existing.
Compatibility. Verify the PHP/Laravel support matrix has not narrowed in this patch. Because the change introduces a new write-time rejection, compatibility risk is less about framework versions and more about existing data: any rule already self-parented or orphaned is now a latent error. That is a data-compatibility question, not a code one.
Sequencing.
acr:doctor read-only and inventory findings — this is the pre-existing damage report, captured before any new writes are possible.--fix decision once we know whether one exists.Maintenance. Net-positive: the doctor command is a standing operational asset. Cost is one scheduled job and a runbook entry. The write guard is self-maintaining.
Support. Two new support surfaces. First, admins attempting to re-parent a rule into an invalid position will now be blocked — this needs clear UI copy or it reads as a bug. Second, doctor output needs a triage runbook: who owns orphaned rules, what "safe to delete" means, and when to escalate.
Scaling. The doctor is a full-table integrity scan; on large rule sets it should run off-peak rather than competing with request traffic. Ancestry resolution at evaluation time scales with tree depth, not rule count, so keep hierarchies shallow — the guard makes trees harder to accidentally corrupt but does nothing to bound depth.
Failure modes, ranked.
Ramp-up. Low. One command to learn, one behavioral guard to handle in write paths — roughly half a day of engineering awareness plus the data triage effort, which is the only unbounded piece and depends entirely on what the staging doctor run finds.
Recommendation. Adopt. This is a hygiene release that hands us a diagnostic we would otherwise have had to build. Gate production rollout on a clean staging acr:doctor run, add validation-level handling for the new guard, and schedule the doctor before the next admin edits the rule tree.
How can I help you explore Laravel packages today?