Retiring a revision
When the oldest revision has no client left, retire it. The history declared for it becomes dead code, and the library lists it for you.
List the dead declarations
php artisan revision:prune
Retiring Genesis (the oldest revision) makes 5 declarations dead:
- App\Http\Resources\OrderResource response 'total': was(Genesis),
delete the was() (/srv/app/app/Http/Resources/OrderResource.php:38)
…
Each line names the class, the declaration kind, the field, the dead declaration, what to do and where (lines wrapped here). On the quick-start scenario:
| Class | Kind | Field | Declaration | Location |
|---|---|---|---|---|
StoreOrderRequest | request-body | status | was(Genesis) | StoreOrderRequest.php:27 |
StoreOrderRequest | request-body | total | was(Genesis) | StoreOrderRequest.php:35 |
OrderResource | response | status | was(Genesis) | OrderResource.php:30 |
OrderResource | response | total | was(Genesis) | OrderResource.php:38 |
OrderResource | response | lines.*.quantity | was(Genesis) | OrderResource.php:51 |
It lists each until(P) (delete the field), was(P) (delete that was()) and since(P) (delete the bound, already a
no-op). The command is informative and always succeeds.
It does not read class lifetimes: delete a class whose
lifetime ends at the retired revision yourself, and the since() of a lifetime that starts there.
Delete the case
Remove the case from the enum and from order(). PHPStan reports any reference left.
Re-lock the new oldest revision
Delete the retired revision's lock file, then lock the new oldest revision again: its recorded predecessor is gone.
rm revisions.lock/genesis.json
php artisan revision:lock --revision=winter-25
Check
php artisan revision:check
A queued job captured in the retired revision and run afterwards fails with UnknownRevisionException: drain the
queues first.
JSON:API users: Checking & retiring a revision.