Skip to content

Installation

Docuccino generates OpenAPI documentation from the real shape of your Laravel application. It reads your routes, controllers, form requests, resources, models, and exception handling and produces an accurate document — with no annotations to start.

PHP 8.3+

Laravel 12 or 13

  1. Install the packages. Where do your docs need to be readable? That’s the only question — pick the tab that matches and paste:

    Terminal window
    composer require docuccino/laravel
    composer require --dev docuccino/inference-phpstan

    Readers hit /docs/api on a deployed environment. The adapter ships to production and serves a committed artifact or a warmed cache; the engine stays a dev dependency because analysis belongs wherever you generate, and a production host has no business reading your source.

    The engine is the same package either way: it runs PHPStan with Larastan’s model and container knowledge to read the real types in your code — a build-time job, like your test suite.

  2. Publish the config file — optional, but you’ll want it soon:

    Terminal window
    php artisan vendor:publish --tag=docuccino-config

    This writes config/docuccino.php. The package’s defaults are already active without it, so publish when you want to change something. Out of the box they document every api/* route in your own application, export to docs/openapi.json, and serve an interactive viewer at /docs/api.

    The published file is plain data on purpose — no imports, no class references — so a dev-only install stays safe when production boots with the packages pruned.

  3. Export your first document:

    Terminal window
    php artisan docuccino:export
    Wrote /home/you/invoices-api/docs/openapi.json (openapi-3.2).

That’s it. Open docs/openapi.json, or visit /docs/api in your browser — the bundled viewer is live in your local environment out of the box, and closed everywhere else until you name a gate. Your first export walks through what Docuccino read and what it produced.

Artisan commands

docuccino:export, docuccino:validate, docuccino:diff, docuccino:cache, and docuccino:clear. See the commands reference.

A built-in viewer

An interactive Scalar API reference at /docs/api, its spec at /docs/api.json, served from your own app — no external CDN required.

Automatic integrations

Support for form requests, API resources, Eloquent models, enums, Spatie Data, Spatie Query Builder, Sanctum, Passport, and more — each activates only when you use it.

Extension points

Register your own logic from any service provider with Docuccino::extend(). Every official integration is built with the same tools available to you.

  • Directoryconfig/
    • docuccino.php the single config file — documents, routes, security, viewer
  • Directorydocs/
    • openapi.json your exported document (commit this)
  • Directorystorage/
    • Directorydocuccino/ engine scratch files and the fragment cache (add to .gitignore)

Set DOCUCCINO_ENABLED=false and Docuccino goes completely dormant: the viewer routes are never registered and the artisan commands refuse to run. It’s the switch to reach for on a production host that has no business generating documentation — and one you never need if you installed everything as a dev dependency, because there’s nothing on that host to turn off.