zpm-packages/cron-manager-laravel

Laravel integration for ZPMPackages cron manager.

Maintainers

Package info

github.com/zpm-packages/cron-manager-laravel

pkg:composer/zpm-packages/cron-manager-laravel

Statistics

Installs: 1

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-05-06 05:39 UTC

This package is auto-updated.

Last update: 2026-05-06 05:41:57 UTC


README

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.