maize-tech/laravel-tenant-aware
maize-tech/laravel-tenant-aware helps Laravel apps support multi-tenancy by resolving the active tenant, automatically scoping Eloquent models and queries, and keeping tenant data isolated with simple configuration and middleware.
Architecture fit. maize-tech/laravel-tenant-aware is a small, conventional Laravel package that layers multi-tenancy onto Eloquent via traits and global scopes (tenant resolution, tenant-aware models, tenant-aware queued jobs). That is idiomatic Laravel — service provider registration plus opt-in traits — so it composes cleanly with existing application architecture rather than imposing a container or connection model. The 2.2.0 delta does not change this: eight of the nine listed changes are Dependabot bumps to CI actions (aglipanci/laravel-pint-action, dependabot/fetch-metadata), which carry zero runtime footprint. The only substantive change is PR #33, "Add Laravel 13 support and drop PHP 8.1."
Integration feasibility. High, with one gate. The package remains a standard Composer dependency; adopting or upgrading it is a composer.json constraint change plus a config publish, not an application refactor. The gate is the runtime floor: PHP 8.1 is no longer supported, so any service still on 8.1 must remain pinned to 2.1.x. Whether that is acceptable depends entirely on our fleet inventory, which I do not have — this is the single item that must be resolved before we can call the upgrade "routine."
Technical risk. Low in absolute terms, moderate in one specific dimension. The functional risk is near-zero: no public API changes, no behavioural changes to tenant resolution or scoping are described, and the dependency bumps touch only GitHub Actions metadata. The versioning-discipline risk is real, however. Dropping a PHP minor version is a backward-incompatible change for consumers, yet it shipped in a patch-level-adjacent minor (2.1.0 → 2.2.0) rather than a major. That tells us the maintainer treats platform-floor bumps as non-breaking, which means we cannot rely on SemVer alone to gate future upgrades — we need a manual changelog review step in our dependency process. The second-order risk is inherent to the category, not to this release: multi-tenancy isolation is security-critical, and it is being provided by a single-maintainer package. A defect here is a cross-tenant data leak, not a bug.
Key questions.
DB::table() unscoped.Caveat: this is a first assessment derived solely from the 2.2.0 changelog. No package source, documentation, or dependency manifest was supplied; architecture and risk conclusions are inferred from the package's stated purpose and should be validated against the repository before commitment.
Stack fit. Laravel 10–13 with PHP 8.2+ is the target envelope implied by this release; the prior line (2.1.x) remains the correct choice for any PHP 8.1 host. The package is framework-native and adds no new infrastructure — no broker, no sidecar, no separate datastore — so it fits both our monolith and our service-per-domain patterns without changing deployment topology.
Migration path. Upgrade 2.1.0 → 2.2.0 is expected to be source-compatible: update the Composer constraint, run the suite, ship. The work is not in our application code, it is in our runtime images. Two lanes:
Compatibility. Two constraints must be satisfied simultaneously: PHP ≥ 8.2 and Laravel ≤ 13. Because both moved in the same PR, the safest verification is a full matrix run (PHP 8.2/8.3/8.4 × Laravel current/13) rather than spot-checking. Laravel 13 support is additive, so it should not regress existing versions — but "should not" is exactly what the matrix run is for.
Sequencing.
Maintenance. The project shows signs of active upkeep — Dependabot is wired up and merged, and a maintainer merged the Laravel 13 PR — but the 2.2.0 content is almost entirely automated housekeeping. That is a healthy signal for a small package and a weak signal for roadmap investment. We should expect compatibility maintenance rather than feature development, and plan accordingly: no dependency on new capabilities arriving.
Support. Near-zero incremental support load from this release, since nothing user-facing changed. The support risk is asymmetric: teams pinned to 2.1.x on PHP 8.1 receive no further fixes, including security fixes, and will need an internal decision record acknowledging that exposure. Onboarding cost is low — traits and global scopes are familiar Laravel idioms, so a mid-level engineer can read the package in an afternoon.
Scaling. Unchanged by 2.2.0, but worth stating because it is the operational property that matters most. Global-scope-based tenancy adds a predicate to every tenant-aware query; in a large shared database this puts weight on tenant-id indexes and can degrade badly if composite indexes were designed without the tenant column leading. Any scaling review should treat the package's scoping strategy as a schema-design input, not just a library choice.
Failure modes. Ranked by blast radius:
DB::table(), some relation types). Highest severity, lowest visibility. Mitigate with explicit negative tests in CI, not just happy-path coverage.Ramp-up. Low. Expect roughly half a day for an engineer familiar with Laravel to read the package, instrument the isolation tests, and land the bump on a first service. The real cost sits in the PHP 8.1 image upgrades on affected hosts and in writing the cross-tenant regression tests — both of which are worth doing regardless of this release, and both of which this release conveniently forces onto the roadmap.
How can I help you explore Laravel packages today?