In this remove the .jpg because the second one is a varaible,
Input::file('photo')->move($destinationPath, "$id");
$path = public_path("assets/images/profile/$id");
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
if (!empty(Input::file('photo')) and Input::file('photo')->isValid()) {
$destinationPath = "assets/images/profile/";
Input::file('photo')->move($destinationPath, "$id.jpg");
$path = public_path("assets/images/profile/$id.jpg");
Image::make($path)->resize(
150, null, function ($constraint) {
$constraint->aspectRatio();
}
)->save($path);
}
Agent::where("id", $id)->update($data);
\Session::flash('flash_message', 'Profile Update Successfully');
return redirect('admin/profile');
}
Please or to participate in this conversation.