diff --git a/.env.example b/.env.example index 4868f05..ca6e095 100644 --- a/.env.example +++ b/.env.example @@ -43,4 +43,5 @@ AWS_DEFAULT_REGION=us-east-1 AWS_BUCKET= AWS_USE_PATH_STYLE_ENDPOINT=false -DISPLAY_SWAGGER_UI=true \ No newline at end of file +DISPLAY_SWAGGER_UI=true +DISPLAY_REDOC=true \ No newline at end of file diff --git a/config/pandora.php b/config/pandora.php index fbfb9ce..9fd4fcb 100644 --- a/config/pandora.php +++ b/config/pandora.php @@ -9,5 +9,6 @@ 'api_doc' => [ 'display_swagger_ui' => (bool) env('DISPLAY_SWAGGER_UI', true), + 'display_redoc' => (bool) env('DISPLAY_REDOC', true), ], ]; diff --git a/resources/views/openapi-spec/redoc.blade.php b/resources/views/openapi-spec/redoc.blade.php new file mode 100644 index 0000000..c2fd184 --- /dev/null +++ b/resources/views/openapi-spec/redoc.blade.php @@ -0,0 +1,19 @@ + + + + + + + + {{Config::get('app.name')}} - Documentation + + + + + + + + + + + \ No newline at end of file diff --git a/resources/views/swagger/index.blade.php b/resources/views/openapi-spec/swagger.blade.php similarity index 100% rename from resources/views/swagger/index.blade.php rename to resources/views/openapi-spec/swagger.blade.php diff --git a/routes/web.php b/routes/web.php index a2ec93c..891b7cb 100644 --- a/routes/web.php +++ b/routes/web.php @@ -11,7 +11,19 @@ } if (Config::get('pandora.api_doc.display_swagger_ui')) { - Route::get('/documentation', function () { + Route::get('/swagger-ui', function () { return view('swagger.index'); }); } + +if (Config::get('pandora.api_doc.display_swagger_ui')) { + Route::get('/swagger-ui', function () { + return view('openapi-spec.swagger'); + }); +} + +if (Config::get('pandora.api_doc.display_redoc')) { + Route::get('/redoc', function () { + return view('openapi-spec.redoc'); + }); +}