Commit 7e78b764 authored by Nicolas Widart's avatar Nicolas Widart

Adding force create option

parent c5b0ebec
......@@ -31,13 +31,17 @@ class Imagy
$this->imageFactory = $imageFactory;
}
public function get($path, $thumbnail)
public function get($path, $thumbnail, $forceCreate = false)
{
$filename = '/assets/media/' . $this->newFilename($path, $thumbnail);
try {
$this->finder->get(public_path(). $filename);
if (!$forceCreate) {
return $filename;
}
} catch (FileNotFoundException $e) {
// Continue execution
}
$image = $this->image->make(public_path() . $path);
foreach ($this->config->get("media::thumbnails.{$thumbnail}") as $manipulation => $options) {
......@@ -50,7 +54,6 @@ class Imagy
return $filename;
}
}
/**
* Prepend the thumbnail name to filename
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment