mirror of
https://github.com/Intervention/image.git
synced 2025-02-06 13:59:12 +01:00
fixed laravel 4 url manipulation
This commit is contained in:
parent
1009557c32
commit
bfc49d8702
@ -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) {
|
||||
return $callback($image->make($image_path));
|
||||
|
||||
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user