Laravel 13 + Filament 5 admin panel and REST API for a non-profit developer collective, backed by the Pireon OAuth identity server. The public site is a separate, server-rendered application consuming /api/public/v1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
66 lines
2.8 KiB
PHP
66 lines
2.8 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>{{ __('docs.title') }} · {{ config('app.name') }}</title>
|
|
<meta name="robots" content="noindex">
|
|
|
|
{{-- Self-hosted rather than pulled from a CDN: the docs have to work on a
|
|
laptop with no internet, and a script tag pointing at somebody else's
|
|
server is a dependency this application does not otherwise have. --}}
|
|
<link rel="stylesheet" href="{{ asset('vendor/swagger-ui/swagger-ui.css') }}">
|
|
|
|
<style>
|
|
body { margin: 0; background: #fafafa; }
|
|
|
|
/* Swagger UI ships its own header; this replaces it with something
|
|
that says which server you are actually looking at, because the
|
|
same page exists in local, staging and production. */
|
|
.top {
|
|
display: flex; flex-wrap: wrap; align-items: baseline; gap: .75rem;
|
|
padding: 1rem 1.5rem; background: #1f2430; color: #fff;
|
|
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
}
|
|
.top strong { font-size: 1rem; font-weight: 600; }
|
|
.top span { font-size: .8125rem; color: #9aa4b8; }
|
|
.top a { margin-left: auto; font-size: .8125rem; color: #a5b4fc; }
|
|
.swagger-ui .topbar { display: none; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="top">
|
|
<strong>{{ config('app.name') }} · {{ __('docs.title') }}</strong>
|
|
<span>{{ $environment }} — {{ $server }}</span>
|
|
<a href="{{ $spec }}">openapi.yaml</a>
|
|
@if ($types)
|
|
<a href="{{ $types }}" style="margin-left: 1rem;">api-types.d.ts</a>
|
|
@endif
|
|
</div>
|
|
|
|
<div id="swagger"></div>
|
|
|
|
<script src="{{ asset('vendor/swagger-ui/swagger-ui-bundle.js') }}"></script>
|
|
<script src="{{ asset('vendor/swagger-ui/swagger-ui-standalone-preset.js') }}"></script>
|
|
<script>
|
|
window.ui = SwaggerUIBundle({
|
|
url: @json($spec),
|
|
dom_id: '#swagger',
|
|
deepLinking: true,
|
|
presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset],
|
|
layout: 'BaseLayout',
|
|
// Endpoints are grouped by tag and collapsed: this specification
|
|
// describes two APIs at once, and opening on a wall of expanded
|
|
// operations tells you nothing about which is which.
|
|
docExpansion: 'none',
|
|
defaultModelsExpandDepth: 0,
|
|
tryItOutEnabled: true,
|
|
persistAuthorization: true,
|
|
// "Try it out" has to reach this application, not the placeholder
|
|
// origin in the specification.
|
|
servers: [{ url: @json($apiBase), description: @json($environment) }],
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|