Tooling

Check

Find inconsistent declarations at every revision, locally and in CI.

revision:check compiles every revisioned class at every revision and reports each problem it finds. It never throws on your code: each problem is a diagnostic naming its class, field and revision.

Terminal
php artisan revision:check
   INFO  The revisions of 3 classes are consistent.

When something is wrong, it prints a table with one row per diagnostic, then a summary, and exits with 1:

SeverityCodeClassFieldRevisionMessage
errorconversion-missingApp\Http\Resources\InvoiceResourcepaidwinter-25No down conversion from bool to float for 'paid' (response) at was(Winter25): declare down:.
   ERROR  1 error, 0 warnings in 1 class.

Errors fail the command; warnings do not. Every code is listed, with its fix, in the diagnostics reference.

Options

OptionEffect
--format=jsonprints classes, errors, warnings and the diagnostics, each with code, severity, class, field, revision, message
--listprints the discovered classes only, without checking, to spot a forgotten path

Discovery

The check runs on the classes implementing Revisioned found under discovery.paths (app/ by default), plus the classes listed in discovery.classes (classes of packages or modules outside those paths).

config/revisions.php
'discovery' => [
    'paths' => [app_path(), base_path('modules')],
    'classes' => [Vendor\Billing\InvoiceResource::class],
],

In CI

Run it with the other checks of your pipeline:

.github/workflows/ci.yml
- run: php artisan revision:check

With the lock committed, it also fails when a change leaks into a published revision. In PHPUnit, assertRevisionsAreConsistent() runs the same check (see Testing).

Your own rules can run in the same check: see Custom checks.