/** * Resize an image * * @param \Intervention\Image\ImageManager $image * @param string $width * @param string $height * @return \Intervention\Image\ImageManager|null */ public function resizeImage($image = null, $width = '', $height = '') { try { //Resize image and return return $image->fit($width, $height, function ($constraint) { $constraint->upsize(); }); } catch (Exception $e) { //Unexpected error return null; } }