设置一个table表单,一次上传单个文件和多图
$form->table('files', '文件', function ($table) {
$table->file('file', '文件');
$table->select('coins', '积分')->options([
0 => '免费', 1 => '1 积分',
2 => '2 积分', 3 => '3 积分',
4 => '4 积分', 5 => '5 积分',
]);
$table->multipleImage('images', '预览图');
});
上传成功之后,数据库的files
字段内容是这样的
{
"new_1": {
"file": "files/d883173087f4b4ded28d6464dad45d9a.xlsx",
"coins": "0",
"images": [
"images/cd1a0273f0bcc37b214a6d2c041aa8bf.png",
"images/a52283967a2ebe23cf84ac47e897905d.jpg"
]
},
"new_2": {
"file": "files/3303e2e211fd7197ad29e6ffc717e5a7.xlsx",
"coins": "4",
"images": [
"images/f5f2c80f24ee4c0a2230ecadeb1efed9.png",
"images/48cbd04e5398f2d03a04bd656712e136.png"
]
}
}
但是更新之后,字段内容就这样了........
{
"new_1": {
"coins": "0"
},
"new_2": {
"coins": "4"
}
}