简体   繁体   中英

Laravel Nova uploaded image file not showing on staging environment

I have deployed a laravel application which is using the Nova admin for backend management on Bluehost VPS account. I have creates a symlink between storage and public as recommend in the laravel documentation.

I have set up a resource for uploading images like so

Avatar::make('Image')->onlyOnIndex(),

Image::make('Image')->disk('public')
->path('item-category')->required()->hideFromIndex()

I am using the public disk for storage with the filesystem disk configuration like so

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

On my local system, I am able to see the actual image displayed but on the staging the image is uploaded successfully but does not display because the image is not found在此处输入图像描述

The record is stored in the db like so在此处输入图像描述

Why does this same configuration work on my local dev system but not on the staging server? Spent the best part of my morning trying to figure this out.

Try running the artisan command php artisan storage:link , that will create a symlink from your public folder to the storage folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM