PHPackages                             hlacos/joboquent - 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. hlacos/joboquent

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

hlacos/joboquent
================

Simple bundle to store queued jobs statuses and history.

017PHP

Since Oct 6Pushed 11y ago1 watchersCompare

[ Source](https://github.com/Hlacos/joboquent)[ Packagist](https://packagist.org/packages/hlacos/joboquent)[ RSS](/packages/hlacos-joboquent/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Joboquent
=========

[](#joboquent)

Eloquent based Jobs for Laravel

It's under development, not recommended for production use!

Install steps
=============

[](#install-steps)

1. add bundle to composer: "hlacos/joboquent": "dev-master"
2. composer install
3. add service provider to the providers list: 'Hlacos\\Joboquent\\JoboquentServiceProvider'
4. php artisan migrate --package="hlacos/joboquent"
5. php artisan db:seed --class="Hlacos\\Joboquent\\JobStatusTableSeeder"

Usage
=====

[](#usage)

Create new job and run it
-------------------------

[](#create-new-job-and-run-it)

Tipically it creates in the controller.

```
$job = new JobModel;
$job->name = 'Export customers';
$job->save();

$job->run('MyJob');
```

The string parameter of the run method is the class name of the Worker in the next step.

### Extended JobModel

[](#extended-jobmodel)

Feel free to extend this model, just read the extended model section in the worker.

Create worker
-------------

[](#create-worker)

Extend Job to make your own working code

```
use Hlacos\Joboquent\Job;

class MyJob extends Job {
    // Callbacks
    public function beforeStart() {}

    public function beforeEnd() {}

    // The working code
    public function work() {}
}
```

### Worker use extended JobModel

[](#worker-use-extended-jobmodel)

Only override the $jobModelClass public attribute name to the Extended class name.

### Callbacks

[](#callbacks)

1. beforeStart: runs before the work method. You can initialize data or clean up database...
2. beforeEnd: runs before the queue job deleted. You can touch related models timestamps or move created files to their public folder...

### Set the current percent

[](#set-the-current-percent)

Tipically used in the work method in a cycle.

```
$this->jobModel->setPercent($percent);
```

Related models
--------------

[](#related-models)

You can set polimorphic relation to the JobModel.

```
public function jobs() {
    return $this->morphMany('Hlacos\Joboquent\JobModel', 'jobable');
}
```

```
public function job() {
    return $this->morphOne('Hlacos\Joboquent\JobModel', 'jobable');
}
```

Don't forget to save related model to the jobModel before it runs.

TODO
====

[](#todo)

1. Refactoring / code cleaning.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fc02ed73047a5c4baec884c0a87d6f9f50c3cfa9d1d4c8b2718034d75c7e6a4?d=identicon)[Hlacos](/maintainers/Hlacos)

---

Top Contributors

[![Hlacos](https://avatars.githubusercontent.com/u/1110554?v=4)](https://github.com/Hlacos "Hlacos (1 commits)")

### Embed Badge

![Health badge](/badges/hlacos-joboquent/health.svg)

```
[![Health](https://phpackages.com/badges/hlacos-joboquent/health.svg)](https://phpackages.com/packages/hlacos-joboquent)
```

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.5M29](/packages/league-geotools)[illuminate/bus

The Illuminate Bus package.

6045.5M505](/packages/illuminate-bus)[uecode/qpush-bundle

Asynchronous processing for Symfony using Push Queues

1672.5M2](/packages/uecode-qpush-bundle)[jayazhao/think-queue-rabbitmq

为 ThinkPHP5.1 队列增加 RabbitMQ 驱动

141.5k](/packages/jayazhao-think-queue-rabbitmq)

PHPackages © 2026

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