amrlotfy/laravel-chores · Laravel 12 & 13

Data chores that
survive anything.

Backfills, cleanups, and purges over big tables — batched, checkpointed, and resumable. You write the per-record logic. Chores handles the rest. No Redis, no queue workers.

composer require amrlotfy/laravel-chores Star on GitHub
production — ssh

Kill it mid-run — deploy, crash, Ctrl+C. Run the same command again and it resumes from the last checkpoint. No row skipped, no row processed twice.

Checkpointed every batchProgress lives in your database, not in the process. Nothing is lost when the process is.
Failures never block the runA bad record is logged with its exception and skipped. Retry just the failures later.
No infrastructureNo Redis, no workers, no external services. State lives in your DB — on-prem friendly.
The API

You write five lines.

Two methods: which records still need work, and what to do to one record. Batching, ordering, progress, resume, and failure bookkeeping are not your problem anymore.

app/Chores/NormalizePhoneNumbers.php
class NormalizePhoneNumbers extends Chore
{
    // Which records still need work.
    public function collection(): Builder
    {
        return User::whereNotNull('phone')->where('phone', 'not like', '+%');
    }

    // Handle ONE record. Throwing marks it failed — the run continues.
    public function process($record): void
    {
        $record->update(['phone' => PhoneNumber::parse($record->phone, 'EG')->toE164()]);
    }
}
The guarantee

Stated honestly.

Chores iterates by WHERE id > cursor — keyset pagination — and checkpoints to the database after every batch. Kill the process any way you like: on resume, only the rows of the single in-flight batch are re-examined.

Exactly-once beyond the current batch. At-least-once within it. Write process() so handling the same record twice is harmless — most update-style operations already are — and you're fully covered.

The toolkit

Six commands, one habit.

make:chore {name}Scaffold a chore class in app/Chores
chore:run {name}Run a chore — or resume its open run — with live progress
chore:listAvailable chores and recent run history
chore:pause {name}Pause a running chore at its next batch boundary
chore:failures {name}Failed records with their exceptions
chore:retry {name}Re-process only the failed records

--json on run & failures for CI pipelines and AI coding agents. Exit codes: 0 clean · 1 had failures · 2 fatal.

Get started

Give your next backfill a safety net.

$ composer require amrlotfy/laravel-chores $ php artisan vendor:publish --tag=chores-migrations $ php artisan migrate
Star on GitHub View on Packagist