1 | <?php |
||
9 | class ServiceProvider extends IlluminateServiceProvider |
||
10 | { |
||
11 | public function register() |
||
12 | { |
||
13 | $this->app->configure('json-api'); |
||
14 | |||
15 | $this->mergeConfigFrom(__DIR__ . '/../../config/json-api.php', 'json-api'); |
||
16 | |||
17 | $this->app->bind(MediaTypeGuard::class, function ($app) { |
||
18 | return new MediaTypeGuard(config('json-api.media-type'), config('json-api.accept-header-policy'); |
||
|
|||
19 | }); |
||
20 | |||
21 | $this->app->bind(EncoderService::class, function ($app) { |
||
22 | return new EncoderService(config('json-api')); |
||
23 | }); |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * @return array |
||
28 | */ |
||
29 | public function provides() |
||
30 | { |
||
31 | return [MediaTypeGuard::class, EncoderService::class]; |
||
32 | } |
||
33 | } |
||
34 |