Skip to content

Commit 0e34396

Browse files
committed
Boot parent provider after.
Opting to boot the parent provider after prevents the router binding to be fired too early. This was causing issues primarily if the service provider was added to the config after all the other providers. This caused issues primarily with tests because of the execution order of the Kernel. Middlewares were not registered on the router instance. Reference issue dingo#964.
1 parent faa213a commit 0e34396

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Provider/LaravelServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ class LaravelServiceProvider extends DingoServiceProvider
1818
*/
1919
public function boot()
2020
{
21-
parent::boot();
22-
2321
$this->publishes([realpath(__DIR__.'/../../config/api.php') => config_path('api.php')]);
2422

2523
$kernel = $this->app->make('Illuminate\Contracts\Http\Kernel');
@@ -35,6 +33,8 @@ public function boot()
3533

3634
$this->updateRouterBindings();
3735
});
36+
37+
parent::boot();
3838
}
3939

4040
/**

src/Provider/LumenServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ class LumenServiceProvider extends DingoServiceProvider
1616
*/
1717
public function boot()
1818
{
19-
parent::boot();
20-
2119
$this->app->configure('api');
2220

2321
$reflection = new ReflectionClass($this->app);
@@ -47,6 +45,8 @@ public function boot()
4745
'api.throttle' => 'Dingo\Api\Http\Middleware\RateLimit',
4846
'api.controllers' => 'Dingo\Api\Http\Middleware\PrepareController',
4947
]);
48+
49+
parent::boot();
5050
}
5151

5252
/**

0 commit comments

Comments
 (0)