定制 zpm-packages/cron-manager-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zpm-packages/cron-manager-laravel

最新稳定版本:v1.0.0

Composer 安装命令:

composer require zpm-packages/cron-manager-laravel

包简介

Laravel integration for ZPMPackages cron manager.

README 文档

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.

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 8
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固