mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-11 02:50:29 +00:00
351dd87fa9
- 🌐 Added API documentation annotations for multiple controllers (Meetups, Cities, Countries, Courses, Highscores, Venues), improving public and developer-facing endpoint clarity. - ➕ Integrated and configured the `dedoc/scramble` package for automated OpenAPI documentation generation. - 🔒 Excluded internal routes and actions from API documentation using `ExcludeRouteFromDocs` attributes. - 🌍 Added new localization keys for API Token features across multiple languages (`lv`, `es`, etc.). - 🛠️ Introduced `Group`, `Response`, and `QueryParameter` attributes for better request descriptions and structured documentation. - 🚀 Enhanced functionality for listing operations in controllers with filters and query parameters like `search` and `selected`.
33 lines
1.2 KiB
PHP
33 lines
1.2 KiB
PHP
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
<title>{{ $config->get('ui.title') ?? config('app.name') . ' - API Docs' }}</title>
|
|
</head>
|
|
<body>
|
|
<div id="app"></div>
|
|
<script src="{{ $config->renderer()->get('cdn', 'https://cdn.jsdelivr.net/npm/@scalar/api-reference') }}"></script>
|
|
|
|
<script>
|
|
const CSRF_TOKEN_COOKIE_KEY = "XSRF-TOKEN";
|
|
const CSRF_TOKEN_HEADER_KEY = "X-XSRF-TOKEN";
|
|
const getCookieValue = (key) => {
|
|
const cookie = document.cookie.split(';').find((cookie) => cookie.trim().startsWith(key));
|
|
return cookie?.split("=")[1];
|
|
};
|
|
|
|
Scalar.createApiReference('#app', {
|
|
content: @json($spec),
|
|
...@json($config->renderer()->all(except: ['cdn', 'credentials'])),
|
|
onBeforeRequest: ({ requestBuilder }) => {
|
|
requestBuilder.headers.set(CSRF_TOKEN_HEADER_KEY, decodeURIComponent(getCookieValue(CSRF_TOKEN_COOKIE_KEY)))
|
|
},
|
|
customFetch: (input, init) => {
|
|
return window.fetch(input, { ...init, credentials: @json($config->renderer()->get('credentials', 'include')) })
|
|
}
|
|
})
|
|
</script>
|
|
</body>
|
|
</html>
|