Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Tenant Aware

Laravel Tenant Aware Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Easily integrate single-database multi tenant features into your Laravel application

Frequently asked questions about Laravel Tenant Aware
How do I install maize-tech/laravel-tenant-aware in a Laravel app?
Install it as a Composer dependency with composer require maize-tech/laravel-tenant-aware, then publish the package configuration and apply the tenant-aware traits to the models that should be scoped. The package is described as a conventional Laravel package with service provider registration and opt-in traits, so follow the README for the exact provider, config, and middleware steps.
How does laravel-tenant-aware scope Eloquent models for multi-tenancy?
It scopes Eloquent models and queries through tenant-aware traits and global scopes, automatically filtering records for the active tenant. That keeps ordinary Eloquent queries isolated without introducing a separate connection model. Raw SQL and DB::table() queries are not automatically covered by query scopes, so review those paths.
Which Laravel and PHP versions does laravel-tenant-aware support?
The 2.2.0 release adds Laravel 13 support and drops PHP 8.1, so the current line expects PHP 8.2 or newer. The release assessment treats Laravel 10 through 13 as the implied target envelope, but you should confirm the exact Laravel matrix in composer.json before upgrading. Any host still on PHP 8.1 must remain pinned to 2.1.x.
How do I configure tenant resolution and middleware in laravel-tenant-aware?
Configuration centers on resolving the active tenant and applying the package middleware, then opting models into tenant-aware traits and global scopes. Publish the package config to set your tenant resolution rules, and confirm the middleware placement in your HTTP and queue stacks. Check the README for exact keys and supported resolvers.
Does laravel-tenant-aware support tenant-aware queued jobs?
The package includes tenant-aware queued jobs so tenant context can be preserved when work runs asynchronously. You still need to ensure the tenant is resolved before dispatch and that the job uses the package's tenant-aware job support. Confirm the exact trait or middleware from the README for your Laravel version.
Is laravel-tenant-aware safe for production multi-tenant data isolation?
The package can help isolate tenant data by scoping Eloquent queries, but the release assessment warns that query-scope enforcement does not cover raw queries or DB::table() calls. Multi-tenancy isolation is security-critical, so add tests and review every unscoped query path. Also account for the single-maintainer risk and manually review changelogs before upgrades.
Does laravel-tenant-aware support database-per-tenant or only single-database multi-tenancy?
The package is described as single-database multi-tenancy using Eloquent traits and global scopes. The assessment could not confirm whether it also supports connection- or database-per-tenant isolation, and notes that query-scope enforcement leaves raw queries and DB::table() unscoped. Verify this against the repository if database-per-tenant is a requirement.
How do I upgrade laravel-tenant-aware from 2.1.x to 2.2.0?
The 2.1.0 to 2.2.0 upgrade is expected to be source-compatible: update the Composer constraint, run your test suite, and ship. The real gate is PHP 8.1 because 2.2.0 drops it, so hosts on 8.1 must upgrade their base image or stay pinned to 2.1.x. Because the maintainer shipped a platform-floor bump in a minor release, review the changelog manually rather than trusting SemVer alone.
Does the package have tests for cross-tenant data leaks?
The supplied release assessment does not confirm whether the test suite asserts cross-tenant non-leakage or whether CI runs such tests. Before using the package for security-critical isolation, inspect the repository's tests and CI workflows directly. Add your own cross-tenant leakage tests as a safety net.
What alternatives should I consider for Laravel multi-tenancy?
Consider alternatives if you need database-per-tenant or connection-level isolation, because this package focuses on single-database multi-tenancy through Eloquent traits and global scopes. Also compare maintenance activity, security policy, and test coverage for cross-tenant leakage. If raw query or DB::table() isolation is a hard requirement, choose a solution that enforces isolation below the query builder.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings