From b0c2abd5a7db06f41526cc745bdb88c913afa30d Mon Sep 17 00:00:00 2001 From: Romain 'Maz' BILLOIR Date: Sat, 31 Jan 2026 11:01:11 +0100 Subject: [PATCH 1/2] Update security.md with Swagger UI instructions Added instructions for using Swagger UI with API authentication. --- laravel/security.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/laravel/security.md b/laravel/security.md index 388252420fb..a29cae1734d 100644 --- a/laravel/security.md +++ b/laravel/security.md @@ -101,3 +101,22 @@ return [ ], ]; ``` + +If you plan to use Swagger UI to test your API through the browser, also uncomment the `swagger_ui.apiKeys` config to display the Authorization form in Swagger UI: +```php + [ + // .... + 'apiKeys' => [ + 'api' => [ + 'name' => 'Authorization', + 'type' => 'header', + ], + ], + ] +]; +``` +image From 4caa814fdc2dc72f6fd2147d522108ba0ee420be Mon Sep 17 00:00:00 2001 From: soyuka Date: Thu, 3 Dec 2026 10:55:24 +0100 Subject: [PATCH 2/2] docs(laravel): format the Swagger UI apiKeys example --- laravel/security.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/laravel/security.md b/laravel/security.md index a29cae1734d..daba85ada79 100644 --- a/laravel/security.md +++ b/laravel/security.md @@ -102,7 +102,9 @@ return [ ]; ``` -If you plan to use Swagger UI to test your API through the browser, also uncomment the `swagger_ui.apiKeys` config to display the Authorization form in Swagger UI: +If you plan to use Swagger UI to test your API through the browser, also uncomment the +`swagger_ui.apiKeys` config to display the Authorization form in Swagger UI: + ```php [ // .... - 'apiKeys' => [ - 'api' => [ - 'name' => 'Authorization', - 'type' => 'header', - ], - ], - ] + 'apiKeys' => [ + 'api' => [ + 'name' => 'Authorization', + 'type' => 'header', + ], + ], + ], ]; ``` -image + +Swagger UI Authorize button