mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 02:04:03 +00:00
Add guide to make Nova file field thumbnails work (#235)
* Add note about making file field thumbnails work in Nova * code style Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
This commit is contained in:
parent
fd768f14c8
commit
90f08efaa7
1 changed files with 12 additions and 0 deletions
|
|
@ -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`
|
- 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)),
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue