m-h-1/cron-bundle
Cron Bundle is a PHP package for integrating cron job management into Laravel applications. It provides a straightforward way to define scheduled tasks, organize cron entries, and keep recurring jobs manageable within your codebase.
composer require m-h-1/cron-bundle. Despite the Laravel context, this ships as a bundle — expect Symfony-style naming and bootstrapping rather than Laravel package auto-discovery. Check composer.json for extra.laravel.providers first; if there isn't one, you'll register the service provider (or drive the runner class) manually in config/app.php / a small custom provider.LockFactory usage introduced in v1.3.0 — that's the piece that now guards against overlapping runs.php path setting so the runner executes jobs with the same binary your app expects:
* * * * * cd /var/www/app && /usr/bin/php8.3 vendor/bin/<runner> >> /var/log/cron-bundle.log 2>&1
app/Console/Kernel.php:
$schedule->exec('/usr/bin/php8.3 vendor/bin/<runner>')
->everyMinute()
->withoutOverlapping()
->runInBackground();
Keep withoutOverlapping() here as a coarse safety net and let the bundle's own lock handle per-job granularity./usr/bin/php is 7.4 but the app needs 8.3 — set the binary explicitly instead of relying on PHP_BINARY inheritance. Drive it from env:
'php' => env('CRON_BUNDLE_PHP', PHP_BINARY),
Never commit a host-specific absolute path; make it per-environment.php artisan config:cache will freeze your cron config — always re-cache on deploy, and don't compute entries from runtime state (DB rows, request data) inside the config file.flock-style locks are per-host — with two app servers you get two concurrent runs. Use a shared store (Redis/database) whenever you scale horizontally, and confirm the bundle reads that store from config rather than defaulting to a local file./opt/php 8.3/bin/php will silently break. Verify with sudo -u www-data /path/to/php -v.schedule:run firing the same commands, you'll double-run. Pick one owner per job and document it.How can I help you explore Laravel packages today?