Merge pull request #274 from stancl/nova-integration-fix

Improve Nova integration guide
This commit is contained in:
Samuel Štancl 2024-07-06 17:58:21 +02:00 committed by GitHub
commit 98ed6c696d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}
```