cron-manager-laravel maintained by zpm-packages
Laravel Cron Manager
Laravel integration for zpm-packages/cron-manager with two operating modes:
- direct system scheduler management
- database-synced cron management
Installation
composer require zpm-packages/cron-manager-laravel
Configuration
Publish the config and migration when needed:
php artisan vendor:publish --provider="ZPMPackages\LaravelCronManager\CronManagerServiceProvider"
php artisan migrate
The package publishes config/cron-manager.php and exposes config('cron-manager.sync_with_database'):
false: create, update, and delete jobs directly on the system schedulertrue: persist jobs in thecron_manager_cronstable and keep the system scheduler in sync
Additional direct-system visibility options are available under config('cron-manager.system_page'):
show_managed_cron_jobsshow_system_task_schedules
Usage
<?php
use ZPMPackages\LaravelCronManager\Contracts\CronCrudService;
$entry = app(CronCrudService::class)->create([
'schedule' => 'every hour',
'command' => 'php /schedule.php "Cron comment"',
'comment' => 'Cron comment',
]);
Human-friendly schedule strings like every hour and every 5 minutes are normalized through the PHP package before they are stored or synced.
On Windows, direct system mode can list both package-managed cron jobs and imported Task Scheduler entries. Imported tasks use best-effort trigger mapping and may appear with descriptive schedule labels instead of a raw cron expression.
Command Tip
Start with a simple smoke-test command:
php /schedule.php "Cron comment"
Expected output:
Cron comment ran at 2026-05-06 13:45:00
Notes
- The shared
schedule.phpexample lives in the PHP package and is intended as a quick test target. - Windows-safe presets are minute, hour, day, and week based. Monthly and yearly presets are Unix only.
- In direct system mode on Windows,
listcan include imported Task Scheduler entries as well as package-managed jobs. - The system page can independently show or hide package-managed cron jobs and imported Task Scheduler entries through
config/cron-manager.php. - Bulk clear behavior should still be treated as package-managed-only.