mirror of
https://github.com/Intervention/image.git
synced 2025-02-06 22:00:38 +01:00
moved manipulator route registration to boot() method
This commit is contained in:
parent
7791197ada
commit
a64007afa6
@ -20,24 +20,12 @@ class ImageServiceProvider extends ServiceProvider
|
||||
public function boot()
|
||||
{
|
||||
$this->package('intervention/image');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$app = $this->app;
|
||||
|
||||
$app['image'] = $app->share(function ($app) {
|
||||
return new ImageManager($app['config']);
|
||||
});
|
||||
|
||||
// try to create imagecache route only if imagecache is present
|
||||
if (class_exists('Intervention\Image\ImageCache')) {
|
||||
|
||||
$app = $this->app;
|
||||
|
||||
// load imagecache config
|
||||
$app['config']->package('intervention/imagecache', __DIR__.'/../../../../imagecache/src/config', 'imagecache');
|
||||
$config = $app['config'];
|
||||
@ -100,6 +88,20 @@ class ImageServiceProvider extends ServiceProvider
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$app = $this->app;
|
||||
|
||||
$app['image'] = $app->share(function ($app) {
|
||||
return new ImageManager($app['config']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user