Add Storage::link() support #41470
Replies: 2 comments
-
Hi there ✋🏻 From version 7.x and up, you may configure additional symbolic links in your filesystems configuration file. e.g. This will create a symlink from target (public) to source (storage) 'links' => [
public_path('invoices') => storage_path('app/invoices'),
public_path('products') => storage_path('app/products'),
public_path('avatars') => storage_path('app/avatars'),
] Once a file has been stored and the symbolic link has been created, you can create a URL to the files using the asset helper asset("invoices/$invoice->uuid");
asset("products/$product->cover");
asset("avatars/$user->avatar"); |
Beta Was this translation helpful? Give feedback.
-
Hello again :) thanks for your answer. However, I was more speaking of a symlink between files inside the storage section. For example, if i want logo.png and logo-big.png to be the same, I would only need a symlink instead of duplicating the picture ! Hope I made what i wanted clear :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I encountered a case where
Storage::link($target, $source)
would be really handy. It would just create a symlink from target to source.I tried to implement it myself with the use of
Illuminate\Filesystem\Filesystem::link()
function, butFileSystem
keeps getting deeper. I eventually reach all the files involved but it didn t work (without throwing exception). I am no expert to handle this.Beta Was this translation helpful? Give feedback.
All reactions