Home > Software design >  Laravel : Problem showing image from the storage folder
Laravel : Problem showing image from the storage folder

Time:05-13

I'm having a problem viewing image fron the storage folder, here are the codes:

->editColumn('image_path', function ($submission) {
                $imgUrl = asset('storage' . str_replace('public', '', $submission->image_path));
                return "<img src=\"{$imgUrl}\" alt=\"Gambar Barang\" width=\"250\" />";
            })

I tried php artisan storage:link it says the link already exists, last time the image was showing but after i deleted my project folder and pasted a new one the images doesn't showing.

CodePudding user response:

Laravel generate cache version of that storage link..

First step

Delete the storage folder created by storage link command inside a public folder on your root directory

Then execute these commands

php artisan optimize :clear

Then again execute

php artisan storage :link

The output on terminal should be

Symlink recreate the folders

  • Related