Example #1
0
 /**
  * Save a file to cache
  *
  * @param  mixed   $file path|file contents
  * @param  string  $url
  * @param  array   $options
  * @return string
  */
 public function saveFileToCache($file, $url, $options = array())
 {
     $image = $this->worker->load($file)->autoRotate()->resizeCrop($options['resize']['width'], $options['resize']['height'], $options['resize']['x'], $options['resize']['y']);
     $path = $this->getCachedFile($url, $options);
     $this->filesystem->put($path, $image->getString(), ['visibility' => 'public']);
     return $image;
 }