I want to edit the picture, but it doesn't work. What is the syntax for editing a picture?
I tried the following in the controller:
public function edit($id)
{
$makan = Gambar::find($id);
return view('edit_upload',['makan'=>$makan]);
}
public function prosesedit($id, Request $request)
{
$makan = Gambar::find($id);
$makan->nama_makanan = $request->input('makanan');
if($request->hasfile('image'))
{
$file = $request->file('file');
$nama_file = time()."_".$file->getClientOriginalName();
$tujuan_upload = 'image_file';
$file->move($tujuan_upload,$nama_file);
}
$makan->save();
return redirect(route('makan'));
}