2015-08-16 13:59:23 -04:00
|
|
|
<?php
|
|
|
|
|
2015-09-10 14:31:09 -04:00
|
|
|
namespace BookStack\Providers;
|
2015-08-16 13:59:23 -04:00
|
|
|
|
2016-05-01 16:20:50 -04:00
|
|
|
use BookStack\Activity;
|
2018-05-20 13:16:01 -04:00
|
|
|
use BookStack\Image;
|
2015-12-09 14:50:17 -05:00
|
|
|
use BookStack\Services\ImageService;
|
2016-05-01 16:20:50 -04:00
|
|
|
use BookStack\Services\PermissionService;
|
2015-11-21 12:22:14 -05:00
|
|
|
use BookStack\Services\ViewService;
|
2016-05-01 16:20:50 -04:00
|
|
|
use BookStack\Setting;
|
|
|
|
use BookStack\View;
|
|
|
|
use Illuminate\Contracts\Cache\Repository;
|
|
|
|
use Illuminate\Contracts\Filesystem\Factory;
|
2015-08-16 13:59:23 -04:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
2015-09-10 14:31:09 -04:00
|
|
|
use BookStack\Services\ActivityService;
|
|
|
|
use BookStack\Services\SettingService;
|
2016-05-01 16:20:50 -04:00
|
|
|
use Intervention\Image\ImageManager;
|
2015-08-16 13:59:23 -04:00
|
|
|
|
|
|
|
class CustomFacadeProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap the application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register the application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
2018-01-28 11:58:52 -05:00
|
|
|
$this->app->bind('activity', function () {
|
2016-02-28 14:03:04 -05:00
|
|
|
return new ActivityService(
|
2016-05-01 16:20:50 -04:00
|
|
|
$this->app->make(Activity::class),
|
|
|
|
$this->app->make(PermissionService::class)
|
2016-02-28 14:03:04 -05:00
|
|
|
);
|
2015-08-16 13:59:23 -04:00
|
|
|
});
|
2015-08-30 10:31:16 -04:00
|
|
|
|
2018-01-28 11:58:52 -05:00
|
|
|
$this->app->bind('views', function () {
|
2016-02-28 14:03:04 -05:00
|
|
|
return new ViewService(
|
2016-05-01 16:20:50 -04:00
|
|
|
$this->app->make(View::class),
|
|
|
|
$this->app->make(PermissionService::class)
|
2016-02-28 14:03:04 -05:00
|
|
|
);
|
2015-11-21 12:22:14 -05:00
|
|
|
});
|
|
|
|
|
2018-01-28 11:58:52 -05:00
|
|
|
$this->app->bind('setting', function () {
|
2015-09-06 10:26:31 -04:00
|
|
|
return new SettingService(
|
2016-05-01 16:20:50 -04:00
|
|
|
$this->app->make(Setting::class),
|
|
|
|
$this->app->make(Repository::class)
|
2015-09-06 10:26:31 -04:00
|
|
|
);
|
2015-08-30 10:31:16 -04:00
|
|
|
});
|
2016-02-28 14:03:04 -05:00
|
|
|
|
2018-01-28 11:58:52 -05:00
|
|
|
$this->app->bind('images', function () {
|
2015-12-09 14:50:17 -05:00
|
|
|
return new ImageService(
|
2018-05-20 13:16:01 -04:00
|
|
|
$this->app->make(Image::class),
|
2016-05-01 16:20:50 -04:00
|
|
|
$this->app->make(ImageManager::class),
|
|
|
|
$this->app->make(Factory::class),
|
|
|
|
$this->app->make(Repository::class)
|
2015-12-09 14:50:17 -05:00
|
|
|
);
|
|
|
|
});
|
2015-08-16 13:59:23 -04:00
|
|
|
}
|
|
|
|
}
|