Full v4 changelog
Version 4 brings many new features, with the most important ones being:
- Jetstream/Fortify support
- Early identification and a general overhaul of routing logic
- New tenancy bootstrappers
If you’re upgrading from v3, the main changes that will affect you are:
- Namespace changes (mostly database-related things being moved to a dedicated namespace). These are easily resolved with any modern IDE
- New config structure. You will have to delete and republish it (and then re-apply your changes, if any). It’s recommended to also do this with the
TenancyServiceProvider
- Several static properties being removed and replaced with config keys
- Changes to routing logic (if you’re using universal routes)
Diff: d0de09a...master
New features
- Tenant schema dump (
tenants:dump
) command7d98ebb
#807a1a976c
#985cb7567a
#1015ea19117
#1019f851288
- Add Microsoft SQL Server support
cc6d4fe
#715 - Add
ScoutTenancyBootstrapper
f83504a
#936 - Set default value for
tenant
URL parameters when a tenant is identified by pathf2c6408
#925 - Make
tenants:run
handle stdin prompts from subcommands409190f
#923 - Add optional
DeleteTenantStorage
listenerab5fa7a
#938 - Add
BatchTenancyBootstrapper
b78320b
#874 - Add
Storage::url()
support7bacc50
#909a7ad828
222bbe4
- Add tenant-specific maintenance mode
121370e
#761 - Add
current()
andcurrentOrFail()
tenant methods42dab29
#970 - Add option for dropping tenant databases on
migrate:fresh
080b271
#9719520cbc
#1007 - Add maintenance mode events
3f60c4a
#979 - Add cookie option on InitializeTenancyByRequestData
05f1b2d
#980 - Add pending tenants1
198f34f
#8697d3298c
#1025 - Add
DatabaseSessionBootstrapper
(adds support fordatabase
session driver)5849089
- Add session state when impersonating tenant
f42f08c
#1029 - Add a dedicated feature for tenant-specific mail credentials
0f892f1
#989ea5a746
- Add
skip-failing
option totenants:migrate
command342c67f
#945 - Allow defining the tenant connection template using array syntax
087733d
#1040 - Add
RootUrlBootstrapper
(changes APP_URL in CLI context, used e.g. when sending emails in queued jobs that should have links to the tenant’s domain)617e9a7
#1044fbdb13f
#1068719b1be
#1079 - Add
BroadcastTenancyBootstrapper
(makes multi-tenant broadcasting/websockets possible using tenant-specific keys)d7a4982
#1027 - Add
BroadcastChannelPrefixBootstrapper
(makes multi-tenant broadcasting/websockets by prefixing channel names)c34952f
ca400b5
00a00a2
- Add cache prefix mode for separating tenant caches (introduces tenancy support for any cache driver, no longer only Redis)
bd9bbe8
#1014 - Support defining domains for tenants using a
domain
string column instead of a HasMany relatione25e7b7
8b0bdd4
- Add
InitializeTenancyByOriginHeader
9e4f33e
- Add permission-controlled MSSQL database manager
cf3d06c
- Add the option to set headers and middleware in TenantAssetController
a39da04
cc2d555
fdd401f
- Add more tenant key generators
dc43066
55b1c53
- Make tenant column used by path identification parameters configurable, general resolver refactor
0c11f29
- Add
tenant:tinker
command6f4b9da
489fbb9
- Add
Tenancy::$findWith
ac5948d
Changes
- Respect user-defined
$onFail
in the Universal Routes feature233a122
#679 - Change how
tenants:run
is used with argumentsa45aa8e
#912 #686 - Stronger typing, minor changes to the
Tenant
interface55d0a9a
8af354c
87212e5
d463e2d
a94227a
f98a901
942d79c
- Improved namespacing, all database-related logic was moved to namespaces under
Stancl\Tenancy\Database
40bf28c
- Refactor TenantDatabaseManagers
d2e1ce0
- Fix/improve Ignition solutions
55d0a9a
3542b3f
- Reverse order of tenancy bootstrappers when reverting to central context
62d19c5
#932 - Make impersonation tokens require stateful guards
3bf2c39
#935 - Remove configurable static property from
BelongsToTenant
trait (deprecated in PHP 8.1), replace it with a config key24146b2
e5bc8dd
- Refactor more static properties to config keys
ccaba05
- Improve CLI command outputs using Laravel 9+ components
e4f5b92
#9685d688e6
68de360
#1030 - Change
TenantDatabaseManager
-related interfaces, add publicdatabase(): Connection
methodfe0a322
- Make
tenants:migrate
default to configured schema patha1a976c
#985 - Use a dedicated DB connection for creating/deleting tenant databases
bf504f4
#946 (fixes bug #515) - Improve resource syncing logic
77c5ae1
#915 (fixes bug #658)22d1b20
#993ea3e445
#992,758fbc8
#997 (adds polymorphic table for mapping resources to tenants)6784685
- Centralize config used by
BelongsToTenant
andHasDomains
, replace alltenant_id
literalsdd0f03f
2a39b05
(fix #998),82fa6cb
- Convert publishable migrations to anonymous classes
fb2369d
#1001 - Early identification (old version:
ff46bcf
, new version:1d0ca27
), related:4953c69
e4df597
df9324b
c312156
80b1183
- Manual mode improvements (use correct event type, add new listeners)
73c5655
#1013 - Add
remember
bool column toImpersonationToken
228c267
#1101 - Minor
migrate:rollback
fixesb503dbf
- Fix
PathTenantResolver
when resolving tenant from cache8db27a3
, relatedaa1437f
- Require MySQL 8
fd6070f
- Disable
asset_helper_tenancy
by default, make the controller more configurablea39da04
- Simplify
Tenant
contract, moverun()
logic toTenancy
, add genericsaf3b693
- Simplify
TenantWithDatabase
contract, movetenantConfig()
logice8c3c75
29d1469
- Drop Laravel 10 support
ce8e74e
- Add
$ignoreExisting
static property toCreateDatabase
bf1ba69
- Filesystem logic refactor
a41ad69
- Cache prefixing logic rewrite, session scoping improvements
eecf6f2
Package changes
- Tests now use Pest
- Custom Dockerfile, CI no longer uses
docker-compose
- We now use phpstan
- Added API docs: api.tenancyforlaravel.com
Footnotes
-
Feature name subject to change ↩