tjgazel/laravel-docblock-acl
Laravel DocBlock ACL lets you define access control rules directly in PHP docblocks, keeping authorization next to your controller actions. Annotate methods with roles or permissions and the package enforces them automatically—less boilerplate, clearer, self-documenting code.
Architecture fit. The package is a role/permission (RBAC) layer for Laravel. Its core value proposition — authorization primitives attached to the user model, with UI scaffolding for administration — is a commodity concern that nearly every Laravel application must solve. Architecturally it is a low-coupling, in-process library: no external services, no message bus, no schema beyond its own migration tables. That makes the shape of the dependency attractive: it is additive, reversible, and does not dictate application structure.
The v2.0.1 notes indicate the package has converged on a many-groups-per-user model rather than a single-role-per-user model. This is the correct direction for anything beyond a small internal tool, but it is a meaningful data-model decision: it changes the cardinality of the authorization relationship and, by extension, the shape of every policy check and every admin screen built on top of it.
Integration feasibility. Technically straightforward to install, but the compatibility envelope is the headline. The package targets Laravel 6 and 7 only. Both are end-of-life (Laravel 6 LTS reached EOL in September 2022; Laravel 7 in March 2021). For any greenfield or actively maintained application on Laravel 9/10/11, this is not an integration task — it is a fork-and-maintain task. For a legacy application still pinned to Laravel 6/7, integration is feasible and probably cheap.
Technical risk. Ranked:
laravel/ui was superseded by Breeze and Jetstream. Any application on Tailwind, Bootstrap 5, or Inertia will be replacing the shipped views wholesale. Treat the UI as a reference implementation, not a deliverable.Key questions. Before committing, I would want answers to:
Stack fit. Suitable only for applications on Laravel 6 or 7. For those, fit is good: the package slots into the standard App\Models\User relationship model, ships migrations, and provides an admin surface. For Laravel 8+, it is out of envelope — the honest framing to stakeholders is "this is a component for our legacy estate, not for new builds."
The laravel/ui + Bootstrap 4 view layer means the package assumes a server-rendered Blade frontend with the legacy auth scaffolding. Applications on Breeze, Jetstream, Inertia, or a separate SPA will consume the API and data model but discard the views. Budget for that explicitly; it is typically 60–80% of the integration effort and is routinely underestimated.
Migration path. Two distinct migrations need separate plans:
Adopting the package (no prior RBAC): low risk. Ship migrations, seed default roles, backfill from whatever ad-hoc authorization exists today (boolean columns, hardcoded if ($user->is_admin) checks). The backfill is the real work, and it should be done as a one-way data migration with a verification report comparing old and new authorization decisions for a sample of users before cutover.
Upgrading v1.x → v2.0.1: unknown and blocked on the missing changelog. Do not schedule this until the v2.0.0 breaking-change list is obtained. The multi-group-per-user change is the likely culprit — it may alter pivot tables or resolution semantics.
Compatibility. Framework: Laravel 6/7 only — hard gate. PHP: unspecified in the notes; needs confirmation (Laravel 6/7 span PHP 7.2–8.0). Frontend: Bootstrap 4 and laravel/ui for the shipped views; Livewire Full-Page Components supported. Database: unspecified; the package ships migrations, so verify against the target engine and confirm index coverage on the permission lookup path.
Sequencing. For a legacy Laravel 6/7 application:
For a Laravel 8+ application: do not sequence this. Evaluate alternatives first, or budget a fork.
Maintenance. This is the dominant operational cost and it is not the package's fault — it is the version ceiling. Pinning to Laravel 6/7 means the package inherits the EOL status of its host framework. Once the application itself must upgrade, the package becomes a fork obligation: either the maintainer ships Laravel 8+ support, or we own the compatibility work in perpetuity. That is a standing engineering tax that must be visible in the roadmap, not discovered during an upgrade.
Second-order: the view layer's dependence on laravel/ui and Bootstrap 4 will drift from the application's frontend conventions even while the backend remains compatible. Expect to carry a local override of the views.
Support. Unknown maintainer depth. Release notes are in Portuguese, which is fine but implies a primarily Lusophone user base — relevant when estimating how quickly issues get answered and whether English-language documentation and community answers exist. For a library on the authorization critical path, single-maintainer risk is material. Recommend a code-read of the permission resolution logic by someone on our side so we are not wholly dependent on upstream for correctness questions.
Scaling. The package is in-process and issues database queries for permission resolution; the scaling question is therefore entirely about caching and index design, not about the package's own architecture. Three things to validate under load: (a) whether permission lookups are cached per-request, per-session, or not at all; (b) whether cache invalidation is correct and immediate when a user's groups change; (c) whether the pivot tables are indexed on the columns actually used in the hot path. For typical line-of-business loads this is a non-issue. For high-throughput APIs doing per-request authorization, an uncached multi-group resolution can become a measurable query tax — worth a load test before it becomes a production surprise.
Multi-group-per-user adds a small but real cost: resolution is now a set union rather than a single lookup. Negligible individually; relevant only if authorization runs many times per request.
Failure modes. In rough order of likelihood and blast radius:
Ramp-up. Low for developers already fluent in Laravel authorization idioms — the mental model (users → groups → permissions) is conventional, and the API surface is small. Expect under a day to first productive use.
The ramp-up cost that gets missed is on the operations and support side: whoever fields access-change requests needs to understand the group model, and whoever owns the deployment pipeline needs to own the migration. Because the shipped UI is Bootstrap 4 and may be replaced, the admin experience may be something we build — which means we own its documentation and training too.
Finally: v2.0.1 without a v2.0.0 changelog means the team is ramping up on a major version whose breaking changes are undocumented. Closing that gap is the cheapest risk reduction available and should precede any scheduling commitment.
How can I help you explore Laravel packages today?