Search by

prauga / flexdoc

Self-hosted FlexDoc OpenAPI renderer integration for PHP, Laravel, and Symfony

Maintainers

Package info

github.com/Prauga/flexdoc-php

Issues

pkg:composer/prauga/flexdoc

Transparency log

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-09-03 18:35 UTC

This package is auto-updated.

Last update: 2026-09-03 19:42:08 UTC


README

prauga/flexdoc 0.1.0 provides a framework-neutral PHP 8.2+ host for the canonical FlexDoc renderer, plus thin Laravel and Symfony integrations. It is self-hosted and does not require a runtime CDN.

The canonical source remains in the FlexDoc monorepo. Prauga/flexdoc-php is the Composer/Packagist distribution repository and is synchronized automatically from this package directory.

Generic PHP

use Prauga\FlexDoc\FlexDocConfig;
use Prauga\FlexDoc\FlexDocHost;

$host = new FlexDocHost(new FlexDocConfig(path: '/docs', specUrl: '/openapi.json', title: 'My API'));

Map responseForPath() or the three explicit response methods through your HTTP framework.

Laravel

Laravel package auto-discovery loads FlexDocServiceProvider, which binds FlexDocHost and registers the docs and renderer routes. Configure flexdoc.path, flexdoc.spec_url, flexdoc.title, flexdoc.theme, and flexdoc.try_it_enabled in the application config. FLEXDOC_TRY_IT=false is parsed as a boolean and disables Try It. LaravelFlexDoc::register($router, $host) is also available for manual routing.

Laravel normalizes the request path used for route matching, so the single docs route serves both /docs and /docs/; the package integration tests dispatch both forms explicitly.

Symfony

Register FlexDocHost as a service and inject it into Prauga\FlexDoc\Symfony\FlexDocController. Route /docs, /docs/__flexdoc/renderer.js, and /docs/__flexdoc/renderer.css to the controller's corresponding methods.

Packaging

The package contains the version-matched assets/flexdoc.standalone.{js,css}. PHP CI byte-compares them with packages/client/dist/standalone.