1
0
mirror of https://github.com/Intervention/image.git synced 2025-02-06 22:00:38 +01:00

fixed laravel 4 url manipulation

This commit is contained in:
Oliver Vogel 2015-06-26 11:58:56 +02:00
parent 1009557c32
commit bfc49d8702

View File

@ -56,11 +56,21 @@ class ImageServiceProviderLaravel4 extends ServiceProvider
// define template callback
$callback = $config->get("imagecache::templates.{$template}");
if (is_callable($callback)) {
if (is_callable($callback) || class_exists($callback)) {
// image manipulation based on callback
$content = $app['image']->cache(function ($image) use ($image_path, $callback) {
switch (true) {
case is_callable($callback):
return $callback($image->make($image_path));
break;
case class_exists($callback):
return $image->make($image_path)->filter(new $callback);
break;
}
}, $config->get('imagecache::lifetime'));
} else {