You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
630 B
25 lines
630 B
<?php |
|
|
|
namespace App\Http\Controllers; |
|
|
|
use App\Support\OpenApiSpec; |
|
use Illuminate\Http\JsonResponse; |
|
use Illuminate\View\View; |
|
|
|
class ApiDocsController extends Controller |
|
{ |
|
public function index(): View |
|
{ |
|
return view('api-docs.index', [ |
|
'baseUrl' => rtrim(config('app.url'), '/') . '/api/v1', |
|
'oauthUrl' => rtrim(config('app.url'), '/') . '/oauth/token', |
|
'openapiUrl' => route('api-docs.openapi'), |
|
'scopes' => config('api.scopes'), |
|
]); |
|
} |
|
|
|
public function openapi(): JsonResponse |
|
{ |
|
return response()->json(OpenApiSpec::build()); |
|
} |
|
}
|
|
|