驱动程序[]不受支持。- Laravel 5.3
驱动程序[]不受支持。- Laravel 5.3
我正在使用backpackforlaravel来设置我的网站后台区域。我在我的ProjectCrudController中添加了一个图像字段:
$this->crud->addField([ 'label' => "Project Image", 'name' => "image", 'type' => 'image', 'upload' => true, ], 'both');
在我的模型Project中,我有一个mutator,如下所示:
public function setImageAttribute($value) { $attribute_name = "image"; $disk = "public_folder"; $destination_path = "uploads/images"; // 如果图像被删除 if ($value==null) { // 从磁盘中删除图像 \Storage::disk($disk)->delete($this->image); // 在数据库列中设置为空 $this->attributes[$attribute_name] = null; } // 如果发送了base64图像,将其存储在数据库中 if (starts_with($value, 'data:image')) { // 0. 创建图像 $image = \Image::make($value); // 1. 生成文件名 $filename = md5($value.time()).'.jpg'; // 2. 将图像存储到磁盘上 \Storage::disk($disk)->put($destination_path.'/'.$filename, $image->stream()); // 3. 将路径保存到数据库中 $this->attributes[$attribute_name] = $destination_path.'/'.$filename; } }
在我的public文件夹中,我有一个/uploads/images/文件夹。
但是当我想保存一个项目时,我遇到了以下错误:
InvalidArgumentException in FilesystemManager.php line 121:
不支持驱动程序 []。
我的config文件夹中的filesystems.php文件如下所示:
'local', 'cloud' => 's3', 'disks' => [ 'local' => [ 'driver' => 'local', 'root' => storage_path('app'), ], 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), 'visibility' => 'public', ], 's3' => [ 'driver' => 's3', 'key' => 'your-key', 'secret' => 'your-secret', 'region' => 'your-region', 'bucket' => 'your-bucket', ], 'uploads' => [ 'driver' => 'local', 'root' => public_path('uploads'), ], ], 'storage' => [ 'driver' => 'local', 'root' => storage_path(), ], ];
这里可能出了什么问题?我正在使用Laravel Homestead version 2.2.2。