alexkramse/filament-openapi-docs
Filament OpenAPI Docs renders your OpenAPI/Swagger spec as a browsable API reference right inside Filament, so you can explore endpoints, methods, parameters, request bodies, and responses without leaving your admin panel—handy for teams shipping APIs alongside Filament apps.
This release (v1.0.4) is purely additive — nothing you have running will break. Start by reading the README section covering versions() and version(), since that is where the new surface area lives.
Minimal steps to get productive:
composer update the package (no config changes required to keep existing behaviour)./api and an internal /internal-api), register both with Scramble as named APIs, then switch the plugin from the single-generator config to versions([...]).Where to look first:
PanelProvider — this is where every change in this release is expressed.versions() / version() arguments and the label format (labels now include the OpenAPI version and the API path).First use case to try: keep your current single-generator plugin untouched, then add a second plugin instance scoped to one version with version(). That gives you a dedicated, linkable page per API version and validates the "separate plugin instances without page configuration conflicts" fix from this release without touching your existing page.
Legacy single generator (no change). If you document one API, do nothing. Legacy behaviour is explicitly preserved. Treat this as the default and only migrate when you actually have a second version.
In-page selector with versions(). Use this when consumers benefit from switching between API versions on one screen — public API docs where v1 and v2 coexist, or a "latest vs. stable" toggle. One plugin instance, one route, a summary/sidebar selector swaps the rendered spec. Good for discoverability; less good if the versions have wildly different auth or audiences.
Dedicated page per version with version(). Use this when each version needs its own URL, navigation entry, and access rules — e.g. /admin/docs/v1 and /admin/docs/v2, or public docs for one version and an internal-only page for another. Register multiple plugin instances in the same panel, each pinned to one version. This is the pattern that the v1.0.4 instance-isolation fix unlocks; before it, multiple instances in one panel collided on page configuration.
Mixed pattern. Combine both: a versions() page as the general entry point, plus version() pages for the versions you want directly linkable (changelogs, support tickets, Slack pins). Keep the dedicated pages out of navigation (->navigationIcon(null) / hidden nav) if you only want them linkable rather than browsable.
Panel segregation. The most common real-world split is public vs. internal: an unauthenticated or lightly-guarded panel rendering the public spec, and an admin panel rendering internal endpoints. Each panel gets its own plugin instance and its own version config; do not try to share one instance across panels.
Integration tips.
config('openapi.versions')) rather than hardcoding arrays in the provider, so deploys can toggle versions without a code change.canAccessPanel() / the plugin's authorization hook rather than relying on route obscurity — the docs page exposes your entire schema.php artisan route:list | grep docs after adding instances to catch slug collisions early.versions().php artisan config:clear && php artisan route:clear (plus optimize:clear in production). Adding a version is a route change; a cached route table will keep serving the old set of docs pages.vendor:publish, your stale published view will hide the new selector. Republish (or diff the packaged view) before filing a bug that the selector "doesn't appear".version() pages, explicitly decide who can see them — especially for internal APIs sharing a panel with public ones.versions() opportunistically, one panel at a time, keeping the legacy page live until the new one is verified.How can I help you explore Laravel packages today?