Download the PHP package tsitsishvili/documentator without Composer

On this page you can find all versions of the php package tsitsishvili/documentator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package documentator

Documentator

Interactive API documentation for Laravel that mostly writes itself.

Documentator scans your application's routes, FormRequests, API Resources and controller return types to infer documentation automatically, lets you refine anything with PHP attributes, and serves an interactive UI — backed by a standard OpenAPI 3.1 document — so third parties can browse your endpoints, read descriptions, and try requests live.

Requires PHP 8.2+ and Laravel 12 or 13.

Installation

Publish the config (optional):

Visit /docs to see the interactive UI. The raw spec is at /docs/openapi.json. When grouping.sections is configured, each section gets its own UI and split spec, such as /docs/api and /docs/api/openapi.json.

How inference works

For every route matching config('documentator.routes.match'), an ordered pipeline enriches the endpoint:

Source Produces
Route definition verbs, URI, typed path params (numeric constraint / bound-model key → integer), name, auth guess from auth middleware
Controller/closure PHPDoc summary (first line) and description (the rest), so written docblocks become docs
FormRequest rules() parameters with types, required, enums (in:, Rule::enum, Rule::in), formats (email/uuid/date), bounds (min/max), regexpattern, digits→integer, confirmed→a _confirmation field, nullability, nested rules (items.*.id), file uploads → multipart. On GET/HEAD routes these become query parameters instead of a body
Inline validation / request access the same rule parsing for literal $request->validate([...]), request()->validate([...]), Validator::make(..., [...]) arrays, plus request accessors like $request->integer('page'), $request->boolean('active'), $request->query('q'), and request('q'). Validation rules understand escaped dots, exists, inline Rule::exists, and Rule::when. Local PHPDoc tags can refine inline params: @var, @example, @default, @query, @body, @ignoreParam
spatie/laravel-data request/response Data objects — typed properties, enums, nested Data, collections (optional, auto-detected)
spatie/laravel-query-builder query params from literal allowedFilters, allowedSorts, defaultSort, allowedIncludes and allowedFields calls, including simple helper methods, ignored filter values, and custom *QueryBuilder subclasses (optional, auto-detected from source; no runtime dependency)
Laravel Actions rules() on action classes and handle() return types for routes pointing at asController() (optional, auto-detected; no runtime dependency on the package)
Route action return type / return statement a success response schema from a Resource's toArray(), Laravel 13 JsonApiResource (application/vnd.api+json, include, fields[type]), a ResourceCollection, a Resource::collection($q->paginate()) return statement (paginator envelope + page/per_page query params), jsonPaginate() (page[number] / page[size]), literal response()->json([...], 202) payloads, common Laravel response helpers (response(), view(), redirects), service methods that return arrays, or an Eloquent model ($casts + @property). Status follows the verb: POST → 201, DELETE → 204
Generated examples a representative example for every body/parameter — format- and name-aware (email[email protected], *_url, *_name, dates, enums, …) so the playground starts filled
PHP attributes overrides for everything above (runs last)

With spatie/laravel-data

Install spatie/laravel-data and any Data object you type-hint is documented with no extra annotation — request fields from the argument, response schema from the return type:

Overriding with attributes

Attributes always win over inference. Mix and match as needed:

Available attributes: Summary, Description, OperationId, Group, Authenticated, Hidden, Deprecated, BodyParam, QueryParam, HeaderParam, CookieParam, PathParam, RequestMediaType, Server, TagDescription, Response, ResponseHeader, SchemaName. Group, Authenticated, Hidden and Deprecated may also be placed on the controller class to set a default for all its methods (#[Deprecated] also honours PHP 8.4's native #[\Deprecated]). #[Response(resource: X, paginated: true)] (or collection: true) wraps a resource in the paginator / { data: [...] } envelope; add paginationLinks: false for a custom collection that drops Laravel's links blocks. #[Response(type: 'array{id: int}')] and parameter type values support a practical PHPDoc subset: scalars, ?T / T|null, list<T>, T[], array<string, T>, and array shapes like array{id: int, name?: string}.

For versioned APIs, keep the group name stable and put the version on the group:

Documentator emits the version as x-documentator-group-version, shows it as a group badge in the built-in UI, and prefixes generated operation IDs with it to avoid collisions between versions.

Put #[UsesModel(Order::class)] on a Resource to tell the extractor which Eloquent model it wraps (otherwise the model is resolved by naming convention, configurable via models_namespace), so field types come from the model's casts. Use #[SchemaName('PublicOrder')] on a Resource or ResourceCollection when you want a stable components.schemas name instead of the class basename.

Inline parameter PHPDoc

When a controller validates inline, attach a small docblock to a validation item or request accessor to refine the inferred parameter:

Validation keys split on unescaped dots (items.*.id) and preserve escaped dots (user\.uuid) as literal property names.

Authentication

Auth schemes are declared in config('documentator.security') as OpenAPI securitySchemes. Endpoints behind auth middleware are marked authenticated automatically — and auth:<guard> picks the scheme whose key matches the guard name, falling back to default; use #[Authenticated('scheme-key')] to be explicit or pick a non-default scheme. Token-ability middleware (abilities: / ability: / scopes: / scope:) is surfaced as the operation's required scopes. Custom middleware aliases can be mapped with documentator.auth_middleware, for example internal.authinternal. The UI renders the matching authorize / token input.

To require auth across the whole API instead of marking each endpoint, set documentator.authenticate to true (or a scheme name) — it emits a top-level security requirement applied to every operation. Endpoints that aren't authenticated opt out automatically and stay public.

Trying requests

The built-in explorer can call your API live, including documented headers and cookies. It remembers the auth token and selected server across endpoints, deep-links each endpoint (#get-api-orders) for sharing and reload — the Link button copies that deep link — renders Markdown in descriptions, shows documented response headers, and shows a copyable request snippet in cURL, PHP (Laravel Http), JavaScript (fetch), TypeScript, Python (requests), Go, Ruby, Java, C# and HTTPie — cURL, PHP, JS and TypeScript as tabs with the rest under an Other dropdown, and the chosen language is remembered too. The TypeScript snippet generates typed Request / Response interfaces and an async fetch wrapper (with Date hydration).

The request panel is resizable on desktop and becomes an off-canvas drawer on smaller screens. Use Clear to reset path, query and body inputs without forgetting the selected server or auth token. JSON responses render as a collapsible tree with Expand all / Collapse all, while Copy still copies the full formatted response body. Shortcuts: / focuses search, Cmd/Ctrl+Enter sends, Esc closes panels. Cross-origin "try it" calls require the API to allow CORS from the docs origin.

Organizing larger APIs

For applications with multiple route surfaces, configure sections:

Documentator redirects /docs to the first section and serves split specs at /docs/api/openapi.json, /docs/app/openapi.json, and so on. Cached generation also writes section files next to the full cached spec.

Within a section, groups can come from controllers, path segments, or explicit #[Group] attributes:

Route-wide placeholders such as {pathlang} or {tenant} can be described once and reused everywhere:

Those parameters are marked in the OpenAPI document with x-documentator-global, and the metadata is also emitted at x-documentator-global-path-parameters.

Production

The docs are disabled by default. Set DOCUMENTATOR_ENABLED=true and add auth via route.middleware for private APIs before exposing them. To restrict who may view the docs, register an authorization gate from a service provider's boot() — it runs after the route middleware, so the authenticated user is available:

Returning false aborts with a 403. Building the document scans routes per request, so pre-build it:

Keeping docs honest in CI

documentator:check audits the generated docs — it flags endpoints whose action cannot be introspected and endpoints with no documented success schema, and can detect drift from a committed spec, listing the specific path / operation / response changes. It also prints a documentation health summary (operation count, tags, secured operations, missing/generic summaries and generic success responses):

Configuration

Key options in config/documentator.php:

Development

See CONTRIBUTING.md for the contribution workflow, coding standards, and pull-request checklist. For a file-by-file orientation, use the codebase map; for built-in explorer work, use the UI code map.


All versions of documentator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^12.0 || ^13.0
illuminate/routing Version ^12.0 || ^13.0
illuminate/console Version ^12.0 || ^13.0
nikic/php-parser Version ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tsitsishvili/documentator contains the following files

Loading the files please wait ...