Skip to content

Commit a4ba5ca

Browse files
committed
Removed route middleware from service provider
1 parent ac6ab3c commit a4ba5ca

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ Add Service Provider to app.php
2828
],
2929
```
3030

31+
Add the route middleware to Http Kernel
32+
```php
33+
use ApiSkeletons\Laravel\Doctrine\ApiKey\Http\Middleware\AuthorizeApiKey;
34+
35+
$routeMiddleware = [
36+
...
37+
'auth.apiKey' => AuthorizeApiKey:class
38+
];
39+
```
40+
41+
3142
Initialize the ApiKey service for your entity manager in `App\Providers\AppServiceProvider`
3243
```php
3344
use ApiSkeletons\Laravel\Doctrine\ApiKey\Service\ApiKeyService;

src/ServiceProvider.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ public function register(): void
2525
*/
2626
public function boot(): void
2727
{
28-
$this->app['router']->middleware('auth.apiKey', AuthorizeApiKey::class);
29-
3028
if (! $this->app->runningInConsole()) {
3129
return;
3230
}

0 commit comments

Comments
 (0)