PHPackages                             technopers/laravel-trackable-jobs - 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. technopers/laravel-trackable-jobs

ActiveLibrary

technopers/laravel-trackable-jobs
=================================

v2.0(3y ago)053MITPHPPHP ^8.1

Since Dec 28Pushed 3y agoCompare

[ Source](https://github.com/technopers/laravel-trackable-jobs)[ Packagist](https://packagist.org/packages/technopers/laravel-trackable-jobs)[ Docs](https://github.com/technopers/laravel-trackable-jobs)[ RSS](/packages/technopers-laravel-trackable-jobs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

Laravel Trackable Jobs
======================

[](#laravel-trackable-jobs)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e15fe7876868116559f44b152120f14908ad26253f379ebc12a247080bdacba4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746563686e6f706572732f6c61726176656c2d747261636b61626c652d6a6f62732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/technopers/laravel-trackable-jobs)[![Total Downloads](https://camo.githubusercontent.com/25cb15e0dddba8877bbb11109d508f9c1e770edcd77e0f1c24ed44c0c415885f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746563686e6f706572732f6c61726176656c2d747261636b61626c652d6a6f62732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/technopers/laravel-trackable-jobs)[![GitHub Actions](https://github.com/technopers/laravel-trackable-jobs/actions/workflows/main.yml/badge.svg)](https://github.com/technopers/laravel-trackable-jobs/actions/workflows/main.yml/badge.svg)

Laravel trackable jobs is simple yet affective library for tracking background processes by Model entry (row).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require technopers/laravel-trackable-jobs
```

Usage
-----

[](#usage)

You have a process called compress user profile picture. Which is related to specific user. So your job will be

```
class CompressUserProfilePicture {

}
```

This job can easily be tracked by each user, You can have status of this process, What you need to do is that.

### Just add trait called "Trackable" and pass model object

[](#just-add-trait-called-trackable-and-pass-model-object)

```
class CompressUserProfilePicture
{
    use Trackable {
        Trackable::__construct as __trackableConstruct;
    };

    public $user;

    public function __construct($user)
    {
        $this->user = $user;
        $this->__trackableConstruct($user);
    }
}
```

### Find processes by user

[](#find-processes-by-user)

#### Get processes by User

[](#get-processes-by-user)

For that add, Just add trait called "HasTrackedJobs"

```
use HasTrackedJobs;
```

It will add relations and give you finding methods like,

```
public function trackedJobs(): MorphMany
{
    return $this->morphMany(TrackedJob::class, 'trackable');
}

public function finishedJobs(): MorphMany
{
    return $this->morphMany(TrackedJob::class, 'trackable')
        ->where('status', TrackedJobStatuses::STATUS_FINISHED);
}

public function failedJobs(): MorphMany
{
    return $this->morphMany(TrackedJob::class, 'trackable')
        ->where('status', TrackedJobStatuses::STATUS_FAILED);
}

public function runningJobs(): MorphMany
{
    return $this->morphMany(TrackedJob::class, 'trackable')
        ->where('status', TrackedJobStatuses::STATUS_STARTED);
}

public function pendingJobs(): MorphMany
{
    return $this->morphMany(TrackedJob::class, 'trackable')
        ->where('status', TrackedJobStatuses::STATUS_QUEUED);
}
```

#### Also, if you have single job by each model

[](#also-if-you-have-single-job-by-each-model)

For that add, Just add trait called **"HasTrackedJob"** not "HasTrackedJobs"

```
use HasTrackedJob;
```

Which has methods like,

```
public function trackedJob(): MorphOne
{
    return $this->morphOne(TrackedJob::class, 'trackable');
}

public function finishedJobs(): MorphOne
{
    return $this->morphOne(TrackedJob::class, 'trackable')
        ->where('status', TrackedJobStatuses::STATUS_FINISHED);
}

public function failedJobs(): MorphOne
{
    return $this->morphOne(TrackedJob::class, 'trackable')
        ->where('status', TrackedJobStatuses::STATUS_FAILED);
}

public function runningJobs(): MorphOne
{
    return $this->morphOne(TrackedJob::class, 'trackable')
        ->where('status', TrackedJobStatuses::STATUS_STARTED);
}

public function pendingJobs(): MorphOne
{
    return $this->morphOne(TrackedJob::class, 'trackable')
        ->where('status', TrackedJobStatuses::STATUS_QUEUED);
}
```

Usage
-----

[](#usage-1)

### Fetch processes

[](#fetch-processes)

```
$userProcesses = $user->trackedJob()->get();
```

or

```
$userProcesses = $user->trackedJob;
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Hardik Modha](https://github.com/technopers)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

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 ~29 days

Total

4

Last Release

1142d ago

Major Versions

v1.1 → v2.02023-03-27

PHP version history (2 changes)v1.0-betaPHP ^8.0

v2.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/c999da37dfaf9683f77cdbc664ede35da278ce59bfa3412589c937485743b237?d=identicon)[technopers](/maintainers/technopers)

---

Top Contributors

[![technoper-hardik](https://avatars.githubusercontent.com/u/114377492?v=4)](https://github.com/technoper-hardik "technoper-hardik (13 commits)")

---

Tags

technoperslaravel-trackable-jobs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/technopers-laravel-trackable-jobs/health.svg)

```
[![Health](https://phpackages.com/badges/technopers-laravel-trackable-jobs/health.svg)](https://phpackages.com/packages/technopers-laravel-trackable-jobs)
```

###  Alternatives

[spatie/laravel-sitemap

Create and generate sitemaps with ease

2.6k14.6M107](/packages/spatie-laravel-sitemap)[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[stechstudio/laravel-zipstream

A fast and simple streaming zip file downloader for Laravel.

4633.7M3](/packages/stechstudio-laravel-zipstream)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)

PHPackages © 2026

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