Commit e5c6e20e authored by Nicolas Widart's avatar Nicolas Widart

Adding a facade

parent 8b5b2713
<?php namespace Modules\Media\Image\Facade;
use Illuminate\Support\Facades\Facade;
class Imagy extends Facade
{
protected static function getFacadeAccessor() { return 'imagy'; }
}
...@@ -22,9 +22,15 @@ class ImageServiceProvider extends ServiceProvider ...@@ -22,9 +22,15 @@ class ImageServiceProvider extends ServiceProvider
'Modules\Media\Image\Intervention\InterventionFactory' 'Modules\Media\Image\Intervention\InterventionFactory'
); );
$app['imagy'] = $this->app->share(function ($app) { $this->app['imagy'] = $this->app->share(function ($app) {
return new Imagy($app['config'], new InterventionFactory); return new Imagy($app['config'], new InterventionFactory);
}); });
$this->app->booting(function()
{
$loader = AliasLoader::getInstance();
$loader->alias('Imagy', 'Modules\Media\Image\Facades\Imagy');
});
} }
/** /**
......
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