z-song / laravel-admin

Build a full-featured administrative interface in ten minutes
https://laravel-admin.org
MIT License
11.15k stars 2.82k forks source link

上传图片 Error, Error In UploadField.php line 422 : Call to a member function exists() on string, Disk [admin] not configured, please add a disk config in `config/filesystems.php` error' #5293

Closed phantomsom closed 3 years ago

phantomsom commented 3 years ago

Laravel Version: 8.36.2 PHP Version:7.4.16 Laravel-admin: v1.8.11

Screen Shot 2021-04-16 at 3 46 50 PM Screen Shot 2021-04-16 at 3 52 26 PM Screen Shot 2021-04-16 at 3 53 05 PM Screen Shot 2021-04-16 at 3 54 03 PM Screen Shot 2021-04-16 at 3 54 23 PM

Description:

Two errors,

Disk [admin] not configured, please add a disk config in `config/filesystems.php` error' 
Error In UploadField.php line 422 :
Call to a member function exists() on string

Right now, my website's supplier/item database items has 5 items, with all the columns and rows ready, except for the image rows and I am unable to add images for each inventory item, during adding new clothing and editing within Laravel Admin

I am able to add, edit and delete values and have them show up on my shop page [ but I get two errors if I try to upload an image ], and save as new supplier/item

I've referred to and pasted

Within filesystems.php

      'admin' => [
            'driver' => 'local',
            'root' => public_path('uploads'),
            'visibility' => 'public',
            'url' => env('APP_URL').'/uploads',
        ],

Within admin.php,

    'upload' => [

        // Disk in `config/filesystem.php`.
        'disk' => 'admin',

        // Image and file upload path under the disk above.
        'directory' => [
            'image' =>'images',
            'file' =>'files',
        ]
    ],

1) https://github.com/z-song/laravel-admin/issues/1327 2) https://blog.csdn.net/guaiguaiknl/article/details/80332337 3) https://mofuru.net/news/230

2) Error In UploadField.php line 422 : Call to a member function exists() on string

phantomsom commented 3 years ago

Fixed, needed to call php artisan cache:clear and config:clear