›
byrcsc/laravel-checklist · 1.x
Check one or every checklist action chain and alert when stored history no longer matches its hashes.
checklist:verify recalculates one or every checklist action chain. Run it
before trusting an export and on a recurring operations schedule; it exits
with failure when any chain is broken.
php artisan checklist:verifySuccessful output names the number of checked chains:
All 42 checklist(s) verified: every audit chain is intact.With no checklists, the command warns and exits successfully. There is no history to reject.
php artisan checklist:verify --checklist=42A missing identifier exits with failure rather than reporting a false green:
No checklist matched --checklist; nothing was verified.Add -v to print a success line for every intact checklist.
use Illuminate\Support\Facades\Schedule;
Schedule::command('checklist:verify')
->daily()
->onFailure(function (): void {
// Notify your application's operations channel.
});Choose a cadence that matches how quickly your application must detect direct database changes. Verification streams each checklist's action rows, so total work grows with retained history.
ChecklistExport::for() already verifies the selected checklist and includes
the result under chain. To reject a broken export instead of rendering its
status, check directly:
use ByRcsc\LaravelChecklist\Audit\ChainVerifier;
$verification = ChainVerifier::verify($checklist);
if (! $verification->intact) {
throw new RuntimeException($verification->describe());
}
$export = $checklist->toExport();Failure output names the checklist, action row or chain end, position, and reason. Preserve the database before attempting repair. Updating action rows through Eloquent throws, and recomputing history would erase the evidence that it changed.
The package detects chain inconsistency but does not provide a repair command. Recovery policy depends on your application's audit and backup requirements.