Check
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.
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:
| Severity | Code | Class | Field | Revision | Message |
|---|---|---|---|---|---|
| error | conversion-missing | App\Http\Resources\InvoiceResource | paid | winter-25 | No 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
| Option | Effect |
|---|---|
--format=json | prints classes, errors, warnings and the diagnostics, each with code, severity, class, field, revision, message |
--list | prints 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).
'discovery' => [
'paths' => [app_path(), base_path('modules')],
'classes' => [Vendor\Billing\InvoiceResource::class],
],
In CI
Run it with the other checks of your pipeline:
- 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.