From cffbb8d1cb0242ed32db5d19f65d3bc5670dfb71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Sun, 15 Mar 2020 20:12:10 +0100 Subject: [PATCH] Mention creating a public disk to improve performance --- docs/source/v2/filesystem-tenancy.blade.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/source/v2/filesystem-tenancy.blade.md b/docs/source/v2/filesystem-tenancy.blade.md index 78af302..59721fa 100644 --- a/docs/source/v2/filesystem-tenancy.blade.md +++ b/docs/source/v2/filesystem-tenancy.blade.md @@ -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.