mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
Adds note about TenantAssetController and (separately) the new TrustHost middleware in Laravel 8.0 (#114)
* adds caveat about TenantAssetController * adds note about the new TrustHost middleware
This commit is contained in:
parent
ab1b04356d
commit
b587ab4f8c
2 changed files with 19 additions and 3 deletions
|
|
@ -16,7 +16,9 @@ $tenant->domains()->create([
|
|||
]);
|
||||
```
|
||||
|
||||
If you use the subdomain identification middleware, the example above will work for `acme.{any of your central domains}`. If you use the domain identification middleware, use the full hostname like `acme.com`. If you use the combined domain/subdomain identification middleware, `acme` will work as a subdomain and `acme.com` will work as a domain.
|
||||
If you use the subdomain identification middleware, the example above will work for `acme.{any of your central domains}`. If you use the domain identification middleware, use the full hostname like `acme.com`. If you use the combined domain/subdomain identification middleware, you should use both `acme` as a subdomain and `acme.com` for the domain.
|
||||
|
||||
Note that starting with Laravel 8 and up, Laravel TrustHost middleware is enabled by default (see [laravel/laravel#5477](https://github.com/laravel/laravel/pull/5477)). This blocks Domain-based tenant identification since these requests will be treated as 'untrusted' unless added as a trusted host. You can either comment out this middleware in your App\Http\Kernel.php, or you can adding the custom tenant domains in the App\Http\Middleware\TrustHosts.php `hosts()` method.
|
||||
|
||||
To retrieve the current domain model (when using domain identification), you may access the `$currentDomain` public static property on `DomainTenantResolver`.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue