dixieio/eloquent-model-future
A Laravel Eloquent extension for scheduling model changes and handling future-dated attributes, so records can transition to new values automatically over time without extra jobs or manual updates.
Start by locating the package’s registered Artisan command backed by CommitToFutureCommand; run php artisan list and the command’s --help output to confirm the exact command name and option signatures in your app. If the package publishes config or migrations, publish them first and review the model/table that stores future-dated or uncommitted records.
The first practical use case is catching up after a scheduler outage or deployment: run the commit command with untillDate to commit every uncommitted date from the beginning of time through a cutoff. After upgrading to v0.3.0, treat untillDate as the command’s primary catch-up option and verify that any existing automation no longer depends on the command using forDate.
php artisan list
php artisan <commit-command> --help
Use untillDate for backfills, scheduler recovery, and “commit everything pending up to today” workflows. Use forDate for targeted, single-date operations outside the command—for example, when a specific date needs to be committed independently of the backlog. This separation keeps bulk catch-up jobs predictable and avoids accidentally changing the command’s date scope.
In scheduled jobs, prefer untillDate as the default option so missed runs are recovered automatically. Log the resolved cutoff, number of dates committed, and any skipped/uncommitted records. For large backlogs, run the command on a staging copy first and consider chunking or batching around the package’s underlying date/commit API if the command processes many dates in one pass.
Wrap command invocations in tests that cover the boundary date, timezone handling, and idempotency. A safe pattern is to assert that running the command twice with the same untillDate does not duplicate committed records.
Artisan::call('<commit-command>', [
'--untillDate' => now()->toDateString(),
]);
When integrating with application code, keep date parsing centralized—Carbon instances, app timezone, and storage timezone should be consistent between your calls and the package’s command. If the package exposes lower-level services or actions behind the command, prefer those in domain code and reserve the Artisan command for operational workflows.
v0.3.0 changes command behavior: CommitToFutureCommand now uses untillDate rather than forDate. Any script, cron entry, or deployment step that relied on the command’s previous forDate semantics should be updated and regression-tested.
untillDate now includes all uncommitted dates since the beginning of time. That is useful for recovery, but it can produce a large first run on an existing database. Run it against a copy, inspect the volume, and only then run it in production.
The option is spelled untillDate with two ls. Do not “correct” it to untilDate in scripts or config; use the package’s exact option name.
Debug by running the command’s --help, checking the command class for option definitions, and adding temporary logging around the cutoff and committed count. If results look wrong, verify timezone conversion and whether dates are considered “uncommitted” based on the package’s persistence rules. For extension, subclass or decorate the command only after confirming the package does not already expose a service/action for the same commit operation.
How can I help you explore Laravel packages today?