Installation
composer require kstmostofa/laravel-backfill
php artisan migrateThat is the whole install. The migrations ship with the package and load automatically, so migrate picks them up without publishing anything.
What the migration creates
Five small bookkeeping tables. None of them touch your data; they record what a backfill did and how far it got.
| Table | What it holds |
|---|---|
backfill_runs | One row per run: status, cursor, counters, heartbeat, who started it |
backfill_run_errors | One row per failed record, with exception, message and trace |
backfill_locks | The run lock — a unique index is what stops two processes running the same backfill |
backfill_run_batches | Optional per-batch audit trail, off by default |
backfill_ledger | Used only by ledger mode |
See the schema reference for the columns.
Publishing
Publish the config if you want to change any defaults:
php artisan vendor:publish --tag=backfill-configThe migrations and dashboard views can be published too, though you rarely need to:
php artisan vendor:publish --tag=backfill-migrations
php artisan vendor:publish --tag=backfill-viewsWhere backfills live
By default the package scans app/Backfills. Change it with the path config key:
// config/backfill.php
'path' => app_path('Backfills'),Discovery reads the namespace and class name straight out of each file, so your backfills do not have to live under the app namespace — a package or a module directory works just as well.
Optional: the dashboards
The engineer dashboard and operator panel need Livewire:
composer require livewire/livewire// config/backfill.php
'dashboard' => [
'enabled' => true,
'path' => 'backfills',
'operator_path' => 'backfills/tasks',
'middleware' => ['web'],
],Without Livewire the package works exactly as before — the dashboards simply do not register. Nothing errors and nothing needs configuring.
Both panels are closed by default
Outside local, access is denied until you say otherwise. They can start and cancel data changes over production tables, so opening them is a deliberate act. See authorisation.
Optional: the Pulse card
With Laravel Pulse installed, add the card to your Pulse dashboard view:
<livewire:backfill-pulse-card cols="6" />See the Pulse card.