class JsonResponseServiceProvider extends ServiceProvider
12
{
13
/**
14
* Boot the application events.
15
*
16
* @return void
17
*/
18
public function boot()
19
{
20
$this->registerConfig();
21
$this->registerFacade();
22
}
23
24
/**
25
* Register facade.
26
*
27
* @return void
28
*/
29
protected function registerFacade()
30
{
31
$this->app->singleton('json-response.option', function ($app) {
32
return new Option($app['config']->get('json-response'));
33
});
34
$this->app->singleton('json-response.attribute', function ($app) {
35
return new Attribute($app['json-response.option']->instance());
36
});
37
$this->app->singleton('json-response.status', function ($app) {
38
return new Status($app['config']->get('json-response.status'));
39
});
40
$this->app->singleton('json-response.builder', function ($app) {
41
return new JsonResponse($app['json-response.option']->instance(), $app['json-response.attribute']->instance(), $app['json-response.status']->instance());