$file = $request->file('filename')->getClientOriginalName();
$filename = pathinfo($file, PATHINFO_FILENAME);
$extension = pathinfo($file, PATHINFO_EXTENSION);
// Please do comment if you have a better approach
// We all here to find shorter and faster way to get things done
// Thank you
$extension = pathinfo(storage_path('/uploads/my_image.jpg'), PATHINFO_EXTENSION);
dd($extension);