But it doesn't work.
We're going to need a bit more information here. What is the output of the code you've shown? What is the output you were expecting?
Hi, I am using subdomains for my users eg. username.domain.com. Users can upload images to their own storagedisks. in config\filesystems.php I have:
'user' => [
'driver' => 'local',
'root' => NULL,
'visibility' => 'public'
],
and my testfile (which should only display the image):
config(['filesystems.disks.user.root' => storage_path().'/app/'.$username]);
config(['filesystems.disks.user.url' => 'https://'.$username.'.domain.com/storage']);
The files are stored correctly under storage/username but I can not show the image in my views.
I tried with
<img src="{{ Storage::disk('user')->url('14264228_1080854508651067_2414239900366396390_n.png') }}">
But it doesn't work. Please help. Thanks :)
So, when you say yes, what you actually mean, is no.
The file is not in the path you're trying to read it from. You're looking for a file called 14264228_1080854508651067_2414239900366396390_n.png in the storage folder, but your file is in the storage/app/username folder.
Fix your path construction and it should work.
Please or to participate in this conversation.