I want to store the name of the photo in my database and move the image to public/images directory in laravel 5.3. I have done in following ways but I get an error as shown in the snapshot. I have went through this link but couldn't understand it. enter link description here
This is the error I got:
This is the code I am having:
if($request->hasFile('photo')){
$file = $request->file('photo');
$file->move(public_path().'/images/',$file->getClientOriginalName());
$img=Image::make(sprintf('images/%s', $file->getClientOriginalName()));
$img->resize(300,300)->save();
$athlete->athlete_photo = $file->getClientOriginalName();
}