Add note about TenantAssetsController

This commit is contained in:
lukinovec 2024-06-24 14:36:43 +02:00
parent 3f60cdbe58
commit b0f5d2647f

View file

@ -73,3 +73,16 @@ Avatar::make('Avatar', 'photo')
->thumbnail(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;
}
```