this function delete Brand but photo still save in folder inside public/upload/brands/
i want when make delete it remove photo from folder also.
public function deleteBrand($request){
$deletelogo = $this->brandyModel::where('id',$request->id)->first();
$logo = $deletelogo->logo;
if (is_file($logo)){
unlink(public_path('upload/brands'.$logo));
}
$deletelogo->delete();
$notificat = array(
'message' => 'Brand Deleted Successfully',
'alert-type' => 'success',
);
return redirect()->back()->with($notificat);
}