DEV Community

alcivarv
alcivarv

Posted on

3

Laravel Image Upload

I am having issues displaying an image when uploaded. I am able to successfully store the image locally, however, the image is not doing two things:

  • The image is not storing under the original file name
  • I don't think my route works. Is there a class I need to reference to?

I am very new at this and have issues. thanks!

Top comments (1)

Collapse
 
victoravelar profile image
Victor Avelar

If your using the Storage facade it will generate a new name for each image, this is to avoid overrides on your server.

You need to store the filename once it has been stored, you will understand everything more clearly explained by the Laravel team themselves if you read the file upload section of the File Storage docs.

Sentry image

Make it make sense

Make sense of fixing your code with straight-forward application monitoring.

Start debugging →

👋 Kindness is contagious

Dive into this insightful write-up, celebrated within the collaborative DEV Community. Developers at any stage are invited to contribute and elevate our shared skills.

A simple "thank you" can boost someone’s spirits—leave your kudos in the comments!

On DEV, exchanging ideas fuels progress and deepens our connections. If this post helped you, a brief note of thanks goes a long way.

Okay