Core concepts

Docs viewer

PHP autodoc includes a self-contained docs viewer with no CDN or external assets. One route serves the page, OpenAPI JSON, and viewer assets. Laravel registers this route at laravel.url; for other projects, see Installation. The live demo shows a complete generated document.

Configure the viewer in the ui block of your configuration file:

'ui' => [
    'theme' => 'system',
    'logo' => '',
    'wiki_pages' => [],
    'route_groups' => [],
    'sidebar' => [
        'routes' => [
            'show_path' => true,
            'show_title' => false,
            'show_method' => true,
            'show_path_above_title' => true,
        ],
    ],
    'try_it' => [
        'enabled' => true,
        'proxy_url' => '',
    ],
],
  • theme - initial theme: 'system' (the default, follows the OS), 'light', or 'dark'. After a visitor uses the page toggle, the saved value takes precedence.
  • logo - logo image URL.

The sidebar.routes options independently show or hide a route’s path, operation title, and HTTP method badge, and control whether the path appears above the title. They affect only the sidebar; they do not change the OpenAPI summary or description.

Use route_groups to create collapsible sidebar sections. routes matches path prefixes; exact_routes matches entire paths. The first match wins, and unmatched routes appear below the groups:

'route_groups' => [
    [
        'title' => 'Admin',
        'routes' => ['/api/admin'],
        'collapsed' => true,
    ],
    [
        'title' => 'Billing',
        'routes' => ['/api/billing'],
    ],
],

Wiki pages

wiki_pages adds custom markdown pages to the sidebar. Each entry has an id, a title and one content source:

'wiki_pages' => [
    ['id' => 'intro', 'title' => 'Introduction', 'path' => '/var/app/docs/intro.md'],
    ['id' => 'changelog', 'title' => 'Changelog', 'url' => '/wiki/changelog.md'],
],
  • url entries are fetched directly by the browser and have no access control.
  • path entries point to an absolute file on the server, streamed through the docs route. They are scoped to the selected workspace - a client can only reach the wiki pages of its own workspace, and the file path is never exposed to the browser.

Try It panel

try_it.enabled turns the "Try it" request panel on or off. When your docs page and API are served from different origins, set try_it.proxy_url to a CORS proxy - requests are then sent to {proxy_url}/{server}{path}. Same-origin deployments don't need it.

Per-workspace overrides

A workspace can define its own ui block. Its values override the global UI settings, while omitted values inherit the globals.