Tooling

Export and changelog

A JSON Schema per class and revision, and a Markdown changelog of every revision.

JSON Schema export

Terminal
# every revision, class and kind: {revision: {class: {kind: schema}}}
php artisan revision:export

# one revision, one class
php artisan revision:export --revision=winter-25 \
    --class="App\Http\Resources\OrderResource"

The export is a JSON Schema (draft 2020-12) per class, declaration kind (response, request-body, request-query) and revision, read from the same shapes as the rendering and the validation. With one revision, one class and one kind left, it prints a single schema:

The $comment carries the revision's #[Meta]: its description, publication and deprecation days. Nested resources and components (Schema::object([...])->component('Address'), custom types) go to $defs. Conditional fields are not required.

Laravel OpenAPI Generator
Generates OpenAPI 3.0, 3.1 and 3.2 documents from a Laravel application, its routes, form requests and resources.
v1.2.0ark4ne/laravel-openapi-generator

Laravel OpenAPI Generator builds one OpenAPI document per revision from this export.

Changelog

Terminal
# every revision, newest first
php artisan revision:changelog

# --from excluded, --to included
php artisan revision:changelog --from=genesis --to=winter-25

Each revision is headed by its #[Meta], then lists, per class and kind, the fields added, removed, renamed or retyped. An excerpt of php artisan revision:changelog --from=winter-25:

Publish it to your clients, or read it back after a change to check that it says what you meant.

To read the export and the changelog from PHP (a documentation generator, for instance), see Without Laravel.