Mention creating a public disk to improve performance

This commit is contained in:
Samuel Štancl 2020-03-15 20:12:10 +01:00 committed by GitHub
parent cb497f9404
commit cffbb8d1cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,4 +60,10 @@ Storage::disk('public')->put($filename, $data);
Storage::disk('local')->put("public/$filename", $data);
```
Note that every request for a tenant asset requires a full framework boot and tenancy initialization. This is not ideal if you have some assets that occur on each page (like logos). So for non-private assets, you may want to create a disk and use URLs from that disk instead. For example:
```php
Storage::disk('app-public')->url('tenants/logos/' . tenant()->id . '.png');
```
If you want to store something globally, simply create a new disk and *don't* add it to the `tenancy.filesystem.disks` config.