🎉 2.0.0
Main changes
Tenant
objects are now used, instead of arrays, to represent tenants. See the Tenants page.- Tenants can now have multiple domains, so a new
domains
table is used by the DB storage driver. - The
uuid
property on tenants is nowid
. tenancy()
helper now returns an instance ofTenantManager
while thetenant()
helper returns an instance of the currentTenant
. If noTenant
has been identified,null
is returned. Same with theTenancy
andTenant
facades.- Event listeners/hooks have a new syntax:
Tenancy::eventListener('bootstrapping', function () {})
- The tenancy bootstrapping logic has been extracted into separate classes, such as
DatabaseTenancyBootstrapper
,CacheTenancyBootstrapper
etc. - A concept of
Feature
s was introduced. They're classes that provide additional functionality - functionality that is not necessary to bootstrap tenancy. - predis support was dropped. Laravel will drop predis support in 7.x.
- There is new syntax for creating and interacting with tenants, be sure to read those documentation pages again.
- The config was changed a lot, so you should publish and configure it again.
You can publish the configuration like this:php artisan vendor:publish --provider='Stancl\Tenancy\TenancyServiceProvider' --tag=config
DB storage driver
- The
uuid
column in thetenants
table was renamed toid
. Thedomain
column was dropped. - A new migration was added to create the
domains
table. The old migration was renamed, so if you publish migrations again, be sure to delete the old migration, to avoid creating the table twice.
You can publish migrations like this:php artisan vendor:publish --provider='Stancl\Tenancy\TenancyServiceProvider' --tag=migrations
Redis storage driver
- The
uuid
keys are nowid
. - The
domain
key was dropped. - The
_tenancy_domains
key is used to store an array of domains that belong to the tenant.