BookStack/app/Http/Controllers/Api/ApiDocsController.php

29 lines
651 B
PHP
Raw Normal View History

2020-01-13 00:25:14 +08:00
<?php namespace BookStack\Http\Controllers\Api;
use BookStack\Api\ApiDocsGenerator;
class ApiDocsController extends ApiController
{
/**
* Load the docs page for the API.
*/
public function display()
{
$docs = ApiDocsGenerator::generateConsideringCache();
$this->setPageTitle(trans('settings.users_api_tokens_docs'));
2020-01-16 04:18:02 +08:00
return view('api-docs.index', [
'docs' => $docs,
]);
2020-01-13 00:25:14 +08:00
}
/**
* Show a JSON view of the API docs data.
*/
public function json()
2020-01-13 00:25:14 +08:00
{
$docs = ApiDocsGenerator::generateConsideringCache();
return response()->json($docs);
2020-01-13 00:25:14 +08:00
}
}