skip to Main Content

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',
],

7

Answers


  1. Chosen as BEST ANSWER

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


  2. FIXED !!

    Delete public/storage folder and run the command in cmd

    php artisan storage:link

    Login or Signup to reply.
  3. 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
    
    Login or Signup to reply.
  4. 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',
        ],
    
    Login or Signup to reply.
  5. 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',
        ],
    
    Login or Signup to reply.
  6. this works for me !

    cd public_html
    ln -sr ../storage/app/public storage
    
    Login or Signup to reply.
  7. I’ve fixed this by most easy way:

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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search