laravel-admin上传的图片返回的路径怎么为空?导致数据库保存的数据为空
1. 运行环境
1). 当前使用的 Laravel 版本?
laravel9
//: <> (使用 php artisan --version
命令查看)
2). 当前使用的 php/php-fpm 版本?
PHP 版本:php8.2
php-fpm 版本:
3). 当前系统
wsl2 / win10 /ubuntu20.04
//: <> (期待数值 Windows 10 / Ubuntu 20.4 / CentOS 8 )
4). 业务环境
开发环境
//: <> (期待信息 开发环境
或 生产环境
)
//: <> (是否使用负载均衡?请提供相关信息)
5). 相关软件版本
nginx1.18/msyql8
//: <> (提供相关软件的版本,如 Nginx 、MySQL、MongoDB 等)
2. 问题描述?
上传图片路径返回空
//vendor 下image.php上传文件方法
public function prepare($image)
{
if ($this->picker) {
return parent::prepare($image);
}
if (request()->has(static::FILE_DELETE_FLAG)) {
return $this->destroy();
}
$this->name = $this->getStoreName($image);
$this->callInterventionMethods($image->getRealPath());
$path = $this->uploadAndDeleteOriginal($image);
$this->uploadAndDeleteOriginalThumbnail($image);
Log::info('上传的图片路径为--'.$path);
return $path;
}
结果log的数据为空
[2023-11-03 00:40:20] local.INFO: 上传的图片路径为–
暂时没查找出什么原因,准备换个后台了