dagasmart/task-schedule
A Laravel package for defining and managing scheduled tasks with a fluent PHP API. Register recurring jobs, configure intervals, and keep task scheduling organized and maintainable. Lightweight, easy to integrate, and built to fit naturally into Laravel applications.
composer require dagasmart/task-schedule, then publish the package assets (config and migrations) via php artisan vendor:publish --provider="DagasMart\\TaskSchedule\\TaskScheduleServiceProvider" (check the provider/tag names in the package README — tags are often task-schedule-config and task-schedule-migrations).php artisan migrate. This creates the table that stores task definitions (command, cron expression, active flag, timestamps/output columns).config/task-schedule.php) and the package's Task model. These tell you what fields are available for scheduling, enabling/disabling, and monitoring.app/Console/Kernel.php (or routes/console.php in Laravel 11+): $schedule->command('task-schedule:run')->everyMinute()->withoutOverlapping();. The package then evaluates your DB-stored tasks and dispatches the ones whose cron expressions are due.inspire or a custom reports:daily), set its cron expression to * * * * *, confirm it is active, and watch it execute on the next scheduler tick. This validates the install end-to-end before migrating real jobs into the table.Kernel entries and into rows, so operators can pause, reschedule, or add tasks without a deploy. Keep a small number of infrastructure schedules (the package runner, queue workers, backups) in code.TaskSeeder) and treat the table as configuration: idempotent updateOrCreate keyed on a stable task name/slug.tasks:enable, tasks:disable) for day-to-day operations.last_run_at, last_exit_code, and captured output where the package exposes them, and add a scheduled alert (or Laravel Pulse/health check) for tasks that are active but haven't run within their expected window.->onQueue(...) or a queue-backed command) so the scheduler tick stays fast and doesn't block other due tasks.php artisan schedule:work or trigger php artisan task-schedule:run directly to test a single task record without waiting for a tick.withoutOverlapping() on the runner and/or the package's own mutex support, and keep long jobs on the queue.withoutOverlapping and onOneServer rely on a shared cache store. In multi-node deployments, set CACHE_DRIVER to Redis/Memcached/database — the file driver silently breaks "only run once" guarantees.0 2 * * * can be skipped or duplicated. Test with Carbon::setTestNow() around the boundary.dragonmantank/cron-expression); add a test that every seeded task parses.php artisan config:clear and php artisan optimize:clear after changing scheduling config.TaskStarting/TaskFinished style events, if present) for logging and alerting rather than editing vendor code; keep customisations in a service provider or a subclassed Task model bound via the container.How can I help you explore Laravel packages today?