/** * Returns the extension of the attached file, e.g 'jpg' for file.jpg. * * @param Attachment $attachment * @param string $styleName * @return string */ protected function extension(Attachment $attachment, $styleName = '') { return pathinfo($attachment->originalFilename(), PATHINFO_EXTENSION); }