You should always use the public directory. The storage folder is not public and should not be by any means. Also use asset()
function whenever you try to load images/js/css which points directly to your public directory. Example: <img src="{{ asset('images/example.jpg') }}" />
zeriz liked this reply
Thanks geowrgetudor,
Let me explain my issue bit more.
i have used the artisan:link command.
my public images are stored in /storage/app/public/images
my filesystem configs look like:
'links' => [ public_path('storage') => storage_path('app/public'), ],
Why can a visitor see my image at:
http://site.test/images/image.jpg and also at http://site.test/storage/images/image.jpg
when i look at my filesystem there is a symlink from storage to /storage/app/public
I expect that only http://site.test/storage/images/image.jpg should work.
i'm just a bit confused thats all :)
By any chance do you happen to have the same files duplicate inside the public/images
? I don't see any other reason for this to happen.
Strange isnt't it. I never changed configs for this. And no i don't have a image directory in public, only a css and js folder.
As long it only happens with the images folder in public i think i have to live with it :)
Is see most laravel sites i checked use /images. i can't imagine everyone changed their config.
Thanks for replying
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community