mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 02:04:03 +00:00
Merge pull request #274 from stancl/nova-integration-fix
Improve Nova integration guide
This commit is contained in:
commit
98ed6c696d
1 changed files with 13 additions and 0 deletions
|
|
@ -73,3 +73,16 @@ Avatar::make('Avatar', 'photo')
|
||||||
->thumbnail(fn ($value, $disk) => tenant_asset($value)),
|
->thumbnail(fn ($value, $disk) => tenant_asset($value)),
|
||||||
->preview(fn ($value, $disk) => tenant_asset($value)),
|
->preview(fn ($value, $disk) => tenant_asset($value)),
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Important: make sure to update `TenantAssetsController::$tenancyMiddleware` to the identification middleware of your choice.
|
||||||
|
|
||||||
|
E.g. if you're using InitializeByDomainOrSubdomain in your app, set `TenantAssetsController::$tenancyMiddleware` to InitializeByDomainOrSubdomain in TenancyServiceProvider's `boot()` method:
|
||||||
|
|
||||||
|
```php
|
||||||
|
// In App\Providers\TenancyServiceProvider
|
||||||
|
public function boot(): void
|
||||||
|
{
|
||||||
|
// ...
|
||||||
|
TenantAssetsController::$tenancyMiddleware = InitializeTenancyByDomainOrSubdomain::class;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue