From 90f08efaa7185b2f46580b9abdc4cf23c758bea3 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Fri, 27 Jan 2023 05:14:43 +0100 Subject: [PATCH] Add guide to make Nova file field thumbnails work (#235) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add note about making file field thumbnails work in Nova * code style Co-authored-by: Samuel Ć tancl --- source/docs/v3/integrations/nova.blade.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/docs/v3/integrations/nova.blade.md b/source/docs/v3/integrations/nova.blade.md index 865674a..ec23b78 100644 --- a/source/docs/v3/integrations/nova.blade.md +++ b/source/docs/v3/integrations/nova.blade.md @@ -61,3 +61,15 @@ To use Nova inside of the tenant part of your application, do the following: ]) ``` - Set the `domain` in Nova config to `null` + + +## Tenant file thumbnails and previews {#file-thumbnails} +To make the file field previews show correctly, you have to call `thumbnail(fn ($value, $disk) => tenant_asset($value))` and `preview(fn ($value, $disk) => tenant_asset($value))` on the field. + +For example: +```php +Avatar::make('Avatar', 'photo') + ->disk('public') + ->thumbnail(fn ($value, $disk) => tenant_asset($value)), + ->preview(fn ($value, $disk) => tenant_asset($value)), +```