zpm-packages/cron-manager-laravel

Laravel integration for ZPMPackages cron manager.
2,506
Install
composer require zpm-packages/cron-manager-laravel
Latest Version:v1.0.0
PHP:^8.3
License:MIT
Last Updated:May 6, 2026
Links: GitHub  ·  Packagist
Maintainer: zpmlabs

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 scheduler
  • true: persist jobs in the cron_manager_crons table and keep the system scheduler in sync

Additional direct-system visibility options are available under config('cron-manager.system_page'):

  • show_managed_cron_jobs
  • show_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.php example 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, list can 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.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

391,429,217 4,660