1 | <?php |
||
13 | class LaravelServiceProvider extends BaseServiceProvider |
||
14 | { |
||
15 | public function boot() |
||
21 | |||
22 | protected function bootMiddleware() |
||
23 | { |
||
24 | $httpKernel = app('Illuminate\Contracts\Http\Kernel'); |
||
25 | // Global middleware |
||
26 | if ($this->app->environment() !== 'production') { |
||
27 | $httpKernel->pushMiddleware( |
||
28 | ClockworkMiddleware::class |
||
29 | ); |
||
30 | // Register into dingo api middleware |
||
31 | $this->app[DingoMiddlewareRequest::class]->mergeMiddlewares([ |
||
32 | 'clockwork' => ClockworkMiddleware::class, |
||
33 | ]); |
||
34 | } |
||
35 | } |
||
36 | |||
37 | public function register() |
||
47 | |||
48 | protected function registerClockwork() |
||
54 | |||
55 | protected function registerDingo() |
||
62 | |||
63 | protected function registerCors() |
||
67 | } |
||
68 |