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