1 回答
TA贡献1825条经验 获得超4个赞
这可以解决,新版本中的 php 不支持在运行时创建 var,或者它是否检查它是否有文件导致 false。
$sid = Sid::find($id);
$data = [];
if($request->file('file_uploads'))
{
foreach($request->file('file_uploads') as $file)
{
$name = $file->getClientOriginalName();
$path = 'public/file/'.$sid->employee_name;
$file->move($path, $name);
$data[] = $name;
}
}
$sid->employee_sid = $request->employee_sid;
$sid->employee_npk = $request->employee_npk;
$sid->employee_name = $request->employee_name;
$sid->file_uploads = count($data)? json_encode(array_merge(json_decode($sid->file_uploads, true),$data)): $sid->file_uploads;
$sid->save();
- 1 回答
- 0 关注
- 408 浏览
添加回答
举报