Ejemplo n.º 1
0
 /**
  * Get file content
  *
  * @param string|null $size
  * @return string
  * @throws FileManagerException
  */
 public function content($size = null)
 {
     $file_path = $this->fullPath();
     if ($size and array_key_exists($size, $this->thumb->getSizes())) {
         $thumb_path = $this->getPath()->thumbPath($size, $this);
         if (FileSystem::exists($thumb_path)) {
             $file_path = $thumb_path;
         }
     }
     if (FileSystem::exists($file_path)) {
         return LaravelFile::get($file_path);
     }
     throw new FileManagerException($this, 'err_file_not_found');
 }