mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
Mention creating a public disk to improve performance
This commit is contained in:
parent
cb497f9404
commit
cffbb8d1cb
1 changed files with 6 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue