These docs are for v1.0. Click to read the latest docs for v5.

Hyn approach to tenancy

Global integration

Each tenant is neatly integrated into any functionality you can come up with globally. Packages from the root vendor folder, global routes, all files in the public directory etc..

Another benefit of both the global functionality ánd a system connection is the ability to use global users and localized (tenant-only) users.

Tenant separation

Each tenant is separated from another tenant both by files and by database.

The files separation applies to the following:

  • composer.json, full composer functionality, generates a vendor directory.
  • providers.php, allows registering service providers and other runtime code.
  • routes.php, used to set up specific routes for this tenant.
  • config, allows overruling global configuration files, use at your own risk.
  • lang, allows using a separate tenant specific set of language files.
  • media, a publicly available directory, eg for using images in views or stylesheets.
  • vendor, in combination with the composer file allows using any packages for only this tenant.
  • views, used for instance for blade or twig templates.

Database mutations

Both the native migrate and seed commands have been gracefully extended to add a tenant option, allowing for easy database management. Or if you want mutation on all tenants at the same time. Of course mutation can also be ran on the system connection alone by leaving out the tenant option in both those commands.