I am trying to upload an image to public folder but I am unable to do this. Following is the code of storing the image.
if($request->hasFile('picture'))
{
$file = $request->file('picture');
$size = $file->getSize();
$fileNameWithExt = $file->getClientOriginalName();
$fileName = pathinfo($fileNameWithExt, PATHINFO_FILENAME);
$extension = $request->file('picture')->getClientOriginalExtension();
$fileNameToStore = $fileName.'_'.time().'.'.$extension;
$destinationPath = 'img/';
$file->move($destinationPath, $fileNameToStore);
}