I'm trying to save images from the form input. But it's not working. I have code as following: View:
<form role="form" method="post" action="store" enctype="multipart/form-data">
<label class="control-label">Select Images</label>
<input id="image" name="image[]" multiple type="file">
Controller:
public function store(Request $request)
{
$image = $request->file('image');
$input['imagename'] = time().'.'.$image->getClientOriginalExtension();
$destinationPath = public_path('/images');
$image->move($destinationPath, $input['imagename']);
$this->postImage->add($input);
}
The $image in controller is returning nothing when i tried return($image). What is wrong in here? Can anyone help me?