nie*_*lsv 5 php upload laravel laravel-5 backpack-for-laravel
我正在尝试在页面编辑表单上上传多个图像.在我的PageTemplates.php中,我有:
$this->crud->addField([
'name' => 'images',
'label' => 'Fotos',
'type' => 'upload_multiple',
'upload' => true,
'disk' => 'uploads',
'hint' => 'Some hint text.',
'fake' => true
]);
Run Code Online (Sandbox Code Playgroud)
在我的Page模型中,我有:
public function setImagessAttribute($value)
{
$attribute_name = "images";
$disk = "uploads";
$destination_path = "images/pages";
$this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);
}
Run Code Online (Sandbox Code Playgroud)
在config/filesystems.php的$ disks数组中,我有:
'uploads' => [
'driver' => 'local',
'root' => public_path('uploads'),
],
Run Code Online (Sandbox Code Playgroud)
但是当我尝试保存页面时,我遇到了两个问题:
在我的数据库extras字段中,我得到了:
"images":[
{
},
{
}
],
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
| 归档时间: |
|
| 查看次数: |
740 次 |
| 最近记录: |