我正在尝试将新图像插入数据库,但是出现此错误。有人可以帮我吗?
这是我的FotoController.php:
public function postCreateFoto(Request $request) {
$this->validate($request, [
'image' => 'required|image:jpeg,png,jpg'
]);
$pathName = $request->file('image')->getClientOriginalName();
if($request->hasFile('image')) {
$request->file('image')->storeAs('public/upload', $pathName);
}
$foto = new Foto([
'foto' => $request->input('image')
]);
$foto->save();
return redirect()->route('home');
}