PHPackages                             itsemon245/laravel-pausable-job - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. itsemon245/laravel-pausable-job

ActiveLibrary[Queues &amp; Workers](/categories/queues)

itsemon245/laravel-pausable-job
===============================

This package makes your laravel jobs pauseable and resumable

1.0.3(1y ago)14392[1 issues](https://github.com/itsemon245/laravel-pausable-job/issues)MITPHPCI passing

Since Jul 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/itsemon245/laravel-pausable-job)[ Packagist](https://packagist.org/packages/itsemon245/laravel-pausable-job)[ RSS](/packages/itsemon245-laravel-pausable-job/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

[![Laravel_pausable_job_banner](https://private-user-images.githubusercontent.com/82655944/347915340-a9e055c9-9610-4d4e-94d4-ecc61acfd09b.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU1MjgxMzQsIm5iZiI6MTc3NTUyNzgzNCwicGF0aCI6Ii84MjY1NTk0NC8zNDc5MTUzNDAtYTllMDU1YzktOTYxMC00ZDRlLTk0ZDQtZWNjNjFhY2ZkMDliLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA3VDAyMTAzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI1ZTgzODZhZGVlZjRiNjNmZGUyYjhjZTFjYzIxN2VjZDBlODA2YWM1MzlkMGNjMmRmNTY5YjEyNTJhN2JiOTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.TlENypsEuj6pl11s3qKMkA2rFannz8tgseWfcn1o2T4)](https://private-user-images.githubusercontent.com/82655944/347915340-a9e055c9-9610-4d4e-94d4-ecc61acfd09b.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzU1MjgxMzQsIm5iZiI6MTc3NTUyNzgzNCwicGF0aCI6Ii84MjY1NTk0NC8zNDc5MTUzNDAtYTllMDU1YzktOTYxMC00ZDRlLTk0ZDQtZWNjNjFhY2ZkMDliLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDA3VDAyMTAzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI1ZTgzODZhZGVlZjRiNjNmZGUyYjhjZTFjYzIxN2VjZDBlODA2YWM1MzlkMGNjMmRmNTY5YjEyNTJhN2JiOTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.TlENypsEuj6pl11s3qKMkA2rFannz8tgseWfcn1o2T4)

 [![Total Downloads](https://camo.githubusercontent.com/48673bb09a74364bcf6adafa00c820bc68a20ed5cb717566ce153671833bed90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f697473656d6f6e3234352f6c61726176656c2d7061757361626c652d6a6f623f7374796c653d666f722d7468652d6261646765266c6162656c3d446f776e6c6f61647326636f6c6f723d363143394138)](https://packagist.org/packages/itsemon245/laravel-pausable-job) [![Latest Stable Version](https://camo.githubusercontent.com/535ca04afd70438b9d41f326d3f28265605cd317b0fc1793d38e10bcdf186d1c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f697473656d6f6e3234352f6c61726176656c2d7061757361626c652d6a6f623f7374796c653d666f722d7468652d6261646765266c6162656c3d56657273696f6e)](https://packagist.org/packages/itsemon245/laravel-pausable-job) [![License](https://camo.githubusercontent.com/8671928e801463d6156085826fe53276ca036c60426db553b0b6811011b2812d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f697473656d6f6e3234352f6c61726176656c2d7061757361626c652d6a6f623f7374796c653d666f722d7468652d6261646765266c6162656c3d4c6963656e7365)](https://packagist.org/packages/itsemon245/laravel-pausable-job)

Laravel Pausable Job
====================

[](#laravel-pausable-job)

This package allows your laravel jobs to be **pausable** &amp; **resumeable** by any model in your application on runtime.

Note

**Currently it only supports Laravel's Default Database Connection for Queues**

### The Use Case

[](#the-use-case)

Imagine you have an Email Marketing Application where your clients can create Campaigns and send Emails to their Subscribers. A campaign may have thousands of email in it and you want add a feature so your clients can simply pause the campaign and the email will be paused realtime.

Since campaign emails will likely to be processed by the queue using a job we can no longer pause the queue or the jobs for this specific campaign because they have already been dispatched.
That's where this package comes into play. You can simply pause all the jobs related to a perticular model whenever you want.

### Installation

[](#installation)

```
composer require itsemon245/laravel-pausable-job
```

### Publish Migration

[](#publish-migration)

```
php artisan vendor:publish --provider="Itsemon245\PausableJob\PausableJobServiceProvider"
php artisan migrate
```

### Usage

[](#usage)

1. Use the `Pausable` trait in the job that you want to make pausable

```
//Other imports
 use Itsemon245\PausableJob\Traits\Pausable;

class EmailJob implements ShouldQueue
{
  // Other Traits
   use Pausable;

    public function __construct(public Campaign $campaign)
    {
        /**
         * Set or bind which model is responsible to pause the job
         */
        $this->setPausedBy($campaign);
    }
}
```

2. Use the `HasPausableJobs` trait in the model that you want to use to pause the jobs

```
//Other imports
 use Itsemon245\PausableJob\Traits\HasPausableJobs;

class Campaign extends Model
{
    //Other traits
   use HasPausableJobs;
}
```

3. After using the `HasPausableJobs` trait your model should have access to the `resumeJobs()` method to resume the jobs again. You can now pause and resume the jobs by following this example in your controllers.

```
class CampaignController extends Controller{

  public function pause(Campaign $campaign){
    //Immediately pause all jobs that are related to this campaign
    $campaign->pauseJobs();

    return back();
  }

  public function resume(Campaign $campaign){
  // Resume jobs whenever you want
   $campaign->resumeJobs();
  }

}
```

And with that you now have the ability to pause and resume any job on the fly as long as it relates to a model.

Note

Thank you for considering the package.
This is my first package so feel free to critisize my mistakes &amp; help me overcome them.
And a star would be higly appreciated and will help increase my motivation.

**If you have any suggestion please don't hasitate.**

### Thanks Again &amp; Happy Coding

[](#thanks-again--happy-coding)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance41

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~66 days

Total

4

Last Release

471d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/77df49af7a8f7ee50264b96f33af69a80ca6fe96826db69684fdbdd1dace6034?d=identicon)[itsemon245](/maintainers/itsemon245)

---

Top Contributors

[![itsemon245](https://avatars.githubusercontent.com/u/82655944?v=4)](https://github.com/itsemon245 "itsemon245 (12 commits)")

---

Tags

laravel-packagequeuequeued-jobs

### Embed Badge

![Health badge](/badges/itsemon245-laravel-pausable-job/health.svg)

```
[![Health](https://phpackages.com/badges/itsemon245-laravel-pausable-job/health.svg)](https://phpackages.com/packages/itsemon245-laravel-pausable-job)
```

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[amphp/parser

A generator parser to make streaming parsers simple.

14952.8M16](/packages/amphp-parser)[amphp/serialization

Serialization tools for IPC and data storage in PHP.

13451.1M18](/packages/amphp-serialization)[enqueue/enqueue

Message Queue Library

19820.0M56](/packages/enqueue-enqueue)[deliciousbrains/wp-background-processing

WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks.

1.1k409.8k6](/packages/deliciousbrains-wp-background-processing)[react/async

Async utilities and fibers for ReactPHP

2238.8M171](/packages/react-async)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
