i keep getting 404 image not found when viewing the uploaded image on my project but the image is there. im using laravel's asset() helper to retrieve the image. the url in chrome shows http://127.0.0.1:8000/images/dU8oaVTAwQyTor86jvDtdGKvE7H3MYkHZuUG60gH.png and ive already done php artisan storage:link. any help is greatly appreciated.
You shouldn't use the asset helper for this, the url generated is wrong.
As you use the public storage, the url is supposed to be like this :
http://127.0.0.1:8000/storage/images/dU8oaVTAwQyTor86jvDtdGKvE7H3MYkHZuUG60gH.png
but aren't you supposed to access the image through the public folder if you do php artisan storage:link
Related
I am having trouble displaying the images uploaded using spatie media library with the filament admin panel.
image for clarificatio
This is the code for form schema :
SpatieMediaLibraryFileUpload::make('thumbnail')->collection('posts')
And this is the code for table columns
SpatieMediaLibraryImageColumn::make('thumbnail')->collection('posts')
Thanks.
Check your APP_URL and take care of the correct port.
You should use:
php artisan storage:link
Check in your .env (root folder of your laravel project) file that the APP_URL is the same as your server url.
You get the server url on startup (php artisan server) mine is http://127.0.0.1:8000. (or http://localhost:8000)
So you fill in from APP_URL=http://127.0.0.1 and change to APP_URL=http://127.0.0.1:8000
If you have localhost fill in APP_URL=http://localhost:8000
Check if the files are uploaded to your storgae and been linked with your public folder.
In your CLI: php artisan storage:link
I copy project laravel to new hosting and new domain, its working fine. But the problem is when i upload new image, that image successfully upload to file storage/app/public/upload/folder, but that image not showing on page. See below image
You need to run: php artisan storage:link
to link storage to public folder
I'm saving image in Storage folder path is like:
storage\app\public\img\images_01.png
now in my vue component i'm getting image like this:
this is returning following path :
/storage/img/images_01.png
but the issue is image does not gets displayed.
You can only access files in your public folder. But you can add a symbolic link with php artisan storage:link so you can access what's in storage/app/public
I am using laravel file-manager to store image and it was working fine in http but after changing to https the image are not being displayed although they are being stored in public folder. Only image that are added recently have that problem old image are fine.
The error was in storage:link so after unlinking and then linking that it worked.
i will be glad if anyone can help.
code line
OUTPUT
Have you ran php artisan storage:link? This is usually what does it for me.
Laravel 5 - How to access image uploaded in storage within View?