/** * Returns an image encoded. * * @param string $imagePath * * @return string */ public function getImageBase64($imagePath) { $this->files->clearFileRegister(); return base64_encode($this->files->get($imagePath)->getContent()); }