Level 122
$image = $request->file('image');
$name = time().'.'.$image->getClientOriginalName();
$name = Image::make($name)->resize(10, 10);
You are trying to make an image from a string. $name contains timestamp plus the filename - not the image sent from the browser.
Try this;
if ($request->hasFile('image')) {
$name = time().'.'.$request->file('image')->getClientOriginalName();
$image = Image::make($request->file('image'))->resize(10, 10);
$destinationPath = public_path('/images/members/'. $name);
$image->save($destinationPath);
}
TeamMember::insert([
'name' => $mem_name,
'position' => $position,
'skills' => $skills,
'joined' => $joined,
'image' => $destinationPath,
]);
Not usually a good idea to use the client original filename