packagist stancl/tenancy v2.0.0

latest releases: 3.x-dev, dev-fix-1229, v3.8.4...
4 years ago

🎉 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 now id.
  • tenancy() helper now returns an instance of TenantManager while the tenant() helper returns an instance of the current Tenant. If no Tenant has been identified, null is returned. Same with the Tenancy and Tenant 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 Features 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 the tenants table was renamed to id. The domain 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 now id.
  • The domain key was dropped.
  • The _tenancy_domains key is used to store an array of domains that belong to the tenant.

New Features

Don't miss a new tenancy release

NewReleases is sending notifications on new releases.