3

I have uploaded a voyager admin panel in my cPanel. It gives error Missing storage symlinkand images are not shown of new added item.

Suppose I want to add a new user. All information is shown of new user accept user avatar.

In locally error is easily fixed by running the cmd php artisan storage:link.

But in live server how to fixed this error ?

I have already change the path of storage driver in config/filesystems.php. Change the path from storage_path() to public_path()

'public' => [
    'driver' => 'local',
    'root' => public_path('app/public'),
    'url' => env('APP_URL').'/storage',
    'visibility' => 'public',
],
raff
  • 423
  • 4
  • 13
  • 28

7 Answers7

13

FIXED !!

Delete public/storage folder and run the command in cmd

php artisan storage:link

Arafat Rahman
  • 574
  • 3
  • 11
  • 27
2

this works for me !

cd public_html
ln -sr ../storage/app/public storage
1

It is a path related problem. I have changed the App_url in my .env file. Now it's successfully showing the image.

raff
  • 423
  • 4
  • 13
  • 28
1

I had the same issue. It happened because the file structure or something changed from the original Laravel setup. For me, I switched from using Artisan to vagrant.

I resolved by logging into vagrant and removing the original symlink:

rm -rf /home/vagrant/code/public/storage

I went ahead and created the new symlink but you should now be able to click the Fix link in Voyager admin to create the new one.

ln -s /home/vagrant/code/storage/app/public /home/vagrant/code/public/storage
1

You need to change the storage path into de filesystems.php file

to:

    'public' => [
        'driver' => 'local',
        'root' => storage_path('./../../public_html/storage'),
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
    ],
0

I've fixed this by deleting the public/storage link and folder and then create again the folder and then:

php artisan storage:link

EDIT:

I also had to set this configuration in the filesystems.php

'public' => [
           'driver' => 'local',
           'root' =>  public_path('storage'),
           'url' => env('APP_URL').'storage',
           'visibility' => 'public',
    ],
Emerson Nunes
  • 386
  • 4
  • 17
0

I've fixed this by most easy way:

remove storage folder from public directory, then hit fix button from admin area