The form portion of my view file is:
<form action="/admin/sliders" method="post" enctype="multipart/form-data">
{{ csrf_field() }}
<div class="row">
<div class="col-sm-3 form-group">
<h4 class="slide">Slide photo name</h4>
</div>
<div class="col-sm-8 form-group">
<input class="form-control inbox-del" id="slide_name" name="slider_name" placeholder="Add slide name" type="text">
</div>
</div>
<div class="row">
<div class="col-sm-3 form-group">
<h4 class="slide">Add photo for slide</h4>
</div>
<div class="col-sm-6 form-group slide">
<input type="file" id="slider_link" name="slider_link" placeholder="Add a photo" >
</div>
<div class="col-sm-2 form-group">
<button class="btn btn-primary inbox-del pull-right"> Add Slider </button>
</div>
</div>
</form>
And the controller file is as follows:
public function store(Request $request){
$image = $request->file('image');
$filename = time().$image;
$gallery = new Slider;
$gallery->slider_name= $request->slider_name;
$gallery->slider_link = $filename;
$gallery->save();
$request->slider_link->move(public_path('uploaded'),$gallery->slider_name);
return $request->slider_link;
}
And I get the error: FatalErrorException
Call to a member function move() on null. All the text data is inserted into the database. But the image is not placed in the uploaded directory.