I'm working with Laravel File System. I have done up-to File upload and show from database. Now, I'm facing problem when i'm try to update file in database. I can not load file in
<input type="file" value="{{$file->name}}>"
this way, it's show null. How Can i do this stuff.
Here is my view part.
<form class="" action="{{route('file.update',$file->id)}}" method="post" enctype="multipart/form-data">
@csrf
<input type="hidden" name="_method" value="PUT">
<input type="file" name="image" value="{{$file->name}}">
<br>
<input type="submit" name="" value="update">
</form>
and Here is my Controller part.
public function edit($id)
{
$file=File::find($id);
return view('uploads.edit',compact('file'));
}
public function update(Request $request, $id)
{
return $request->file('image');
}