Home > database >  Images not showing up in laravel
Images not showing up in laravel

Time:04-04

So I have images working on my dev environment, however when i try to see them on the production server I receive a 404 error, the images are located in storage/app/public folder, I have ran the following command:

php artisan storage:link

The output says it works however it is still a 404 error when navigating to /storage/imagefolder/image on the site

CodePudding user response:

Technically images are accessible through the public folder, not the storage folder.

In your Code you can access them like:

<img src="{{ asset('imagefolder/image') }}" />

You can find the correct/final image url with:

dd(asset('imagefolder/image'));

CodePudding user response:

First delete the old symlink

Then from the command:

php artisan storage: link

And to display files: ‌

<img src="{{ asset('imagefolder/fileName') }}" />

or

<img src="{{ /storage/imagefolder/fileName }}" />
  • Related