定制 pm4dev/pause_jobs 二次开发

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

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

pm4dev/pause_jobs

最新稳定版本:1.0.0

Composer 安装命令:

composer require pm4dev/pause_jobs

包简介

Pause Jobs

README 文档

README

A Laravel package that allows you to pause/disable specific jobs without modifying the job code itself.

Installation

  1. Install the package via Composer:
composer require pm4dev/pause_jobs
  1. The package will auto-register itself with Laravel.

How it works

This package adds middleware to Laravel's job bus that checks if a job is in the disabled list before executing it. If a job is disabled, it will be skipped and logged.

Available Commands

Disable a Job

php artisan jobs:disable "App\Jobs\YourJobClass"

Enable a Job

php artisan jobs:enable "App\Jobs\YourJobClass"

List Disabled Jobs

php artisan jobs:list-disabled

Enable All Jobs

php artisan jobs:enable-all

Or force enable without confirmation:

php artisan jobs:enable-all --force

Usage Examples

Disable a specific job

php artisan jobs:disable "App\Jobs\SendEmailJob"

Enable a previously disabled job

php artisan jobs:enable "App\Jobs\SendEmailJob"

Check what jobs are currently disabled

php artisan jobs:list-disabled

Enable all jobs at once

php artisan jobs:enable-all

Storage

The package stores the list of disabled jobs in storage/app/disabled_jobs.json. This file is automatically created and managed by the package.

Logging

When a job is skipped due to being disabled, it will be logged with:

  • Laravel's log system (Log::info)
  • PHP's error log (error_log)

The log message format is: SKIPPED JOB: {JobClassName}

Notes

  • Job class names must be fully qualified (e.g., App\Jobs\YourJobClass)
  • The package validates that the job class exists when disabling
  • Disabled jobs are completely skipped and not executed
  • The disabled jobs list persists across application restarts

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-07-18