Laravel 5.6 file not found in storage - laravel

My Laravel application is about uploading and showing images. It was working good and all images where shown correctly. Now a few weeks later I tried to test it again and it stopped working. Images are in Laravel storage and path is correct but it says: "Failed to load resource: the server responded with a status of 404 (Not Found)".
Path is: http://localhost:8000/storage/images/8/uploaded/1536930406sunflower.png, and it's correct, image is there.
Weird is that it was working for months and now images cannot be found.
Thanks!

I have found the solution to my question and for those who have the same problem:
Storage link in public folder can be possibly broken.
1)Delete storage link in app/public folder.
2)Run command php artisan storage:link to create storage link again.

Also, you have to be sure about your upload folder name and database image addresses are the same.
Otherwise, it will broke and do not forget that it is case sensitive.Example: If image address is "jpg/photo1.jpg" on DB. Your upload folder in storage folder must be "jpg" not "JPG".

Related

How to fix broken Laravel link to local file system?

We inherited a custom laravel app and in the admin area, a link that points to a file in the local storage has broken:
This site can’t be reached
The webpage at https://domain.tld/admin/donor/1818/document/56/DCCA8ACC-7B1B-4D90-977C-257BDA5AE56E.png might be temporarily down or it may have moved permanently to a new web address.
ERR_INVALID_RESPONSE
These links used to work, so I'm not sure what broke. I've verified that the all folders and files in the app have correct permissions and ownership.
You need to make the storage public if you didn’t set it up.
php artisan storage:link
See the docs for more details.

Laravel storage image on server is not showing

Hello laravel storage link image is showing perfectly in localhost and when i upload the project to shared hosting images are broken. To show images i have been using this syntax
<img src="/storage/users_image/{{$user->users_image }}"
the above one works great on localhost on shared hosting this images are broken to solve i make storage link but images are broken again on broken images it shows https://www.yuvxyz.com/storage/users_image/xxxy.png
note i have uploaded public and other folders on different folders.
Finally i got the solution from YouTube and it works i have created symlink then it worked here is the PHP file

image is save in server but cannot be accessed laravel

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.

object not found laravel 5.2 run on php 7.2 windows 10

Recently, I've been downloading laravel project on github.
after I tried to run the file on my localhost, I found error message on my browser. which look like this.
on the first page, I didnt find any error message. but when I clicked on the menu (register, logo=in, services, any menus) I found this error. enter image description here
you're having problem because the object really doesn't exist in your htdocs directory. You don't have to append xampp after localhost or 127.0.0.1 because xampp will treat it as an object or a folder under htdocs.
if you want to access your services, make sure you have a folder under htdocs and put in your URL localhost/foldername

Storing images in storage folder of laravel, and fetching it by a http request is not working

I have deployed laravel application in heroku. I am storing images in storage folder of laravel and trying to fetch it by defining a route. It was working well on local, but when i trying to do the same on server, then its not showing the images. I thought that storage folder is inside the laravel, so it should work fine, but its not working.
Can i store images in public folder by creating a named folder "gallery" inside that and put that gallery folder in gitignore. so will the gitignore folder be vanished when i will push the laravel project again?
Other options are using another file system. Most of them are paid, so i was thinking to save the images in database, is that the good idea or i should move to files only.
First of all, the storage directory should have right permission.
You should create a symbolic link from public/storage to storage/app/public.
Create the symbolic link:
php artisan storage:link
You cannot save images in database, only their names or links etc. I implemented the same thing you did by naming the files to their path and storing that to the database and then using it to fetch the data from folder on sever

Resources