File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff 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+
3142Initialize the ApiKey service for your entity manager in ` App\Providers\AppServiceProvider `
3243``` php
3344use ApiSkeletons\Laravel\Doctrine\ApiKey\Service\ApiKeyService;
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments