PHPackages                             tobento/app-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. tobento/app-job

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

tobento/app-job
===============

The app job lets you monitor queued or ran jobs from a web interface.

2.0.1(4mo ago)04MITPHPPHP &gt;=8.4

Since Aug 27Pushed 4mo agoCompare

[ Source](https://github.com/tobento-ch/app-job)[ Packagist](https://packagist.org/packages/tobento/app-job)[ Docs](https://www.tobento.ch)[ RSS](/packages/tobento-app-job/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (3)Dependencies (18)Versions (5)Used By (0)

App Job
=======

[](#app-job)

The app job lets you monitor queued or ran [jobs](https://github.com/tobento-ch/app-queue) from a web interface.

Table of Contents
-----------------

[](#table-of-contents)

- [Getting Started](#getting-started)
    - [Requirements](#requirements)
- [Documentation](#documentation)
    - [App](#app)
    - [Job Boot](#job-boot)
        - [Job Config](#job-config)
    - [Features](#features)
        - [Jobs Feature](#jobs-feature)
        - [Monitor Jobs Feature](#monitor-jobs-feature)
    - [Console](#console)
        - [Purge Jobs Command](#purge-jobs-command)
    - [Learn More](#learn-more)
        - [Monitor Jobs From Another App](#monitor-jobs-from-another-app)
- [Credits](#credits)

---

Getting Started
===============

[](#getting-started)

Add the latest version of the app job project running this command.

```
composer require tobento/app-job

```

Requirements
------------

[](#requirements)

- PHP 8.4 or greater

Documentation
=============

[](#documentation)

App
---

[](#app)

Check out the [**App Skeleton**](https://github.com/tobento-ch/app-skeleton) if you are using the skeleton.

You may also check out the [**App**](https://github.com/tobento-ch/app) to learn more about the app in general.

Job Boot
--------

[](#job-boot)

The job boot does the following:

- installs and loads job config
- implements jobs interface
- boots [features](#features) configured in [job config](#job-config)

```
use Tobento\App\AppFactory;
use Tobento\App\Job\JobRepositoryInterface;

// Create the app
$app = new AppFactory()->createApp();

// Add directories:
$app->dirs()
    ->dir(realpath(__DIR__.'/../'), 'root')
    ->dir(realpath(__DIR__.'/../app/'), 'app')
    ->dir($app->dir('app').'config', 'config', group: 'config')
    ->dir($app->dir('root').'public', 'public')
    ->dir($app->dir('root').'vendor', 'vendor');

// Adding boots
$app->boot(\Tobento\App\Job\Boot\Job::class);
$app->booting();

// Implemented interfaces:
$jobRepository = $app->get(JobRepositoryInterface::class);

// Run the app
$app->run();
```

You may install the [App Backend](https://github.com/tobento-ch/app-backend) and [boot the job](https://github.com/tobento-ch/app-backend#adding-boots) in the backend app.

### Job Config

[](#job-config)

The configuration for the job is located in the `app/config/job.php` file at the default App Skeleton config location where you can configure [features](#features) and more.

Features
--------

[](#features)

### Jobs Feature

[](#jobs-feature)

The jobs feature provides a jobs page where users can see any jobs queued or ran. In addition, you may requeue failed or completed jobs again.

**Config**

In the [config file](#job-config) you can configure this feature:

```
'features' => [
    new Feature\Jobs(
        // A menu name to show the jobs link or null if none.
        menu: 'main',
        menuLabel: 'Jobs',
        // A menu parent name (e.g. 'system') or null if none.
        menuParent: null,

        // you may disable the ACL while testing for instance,
        // otherwise only users with the right permissions can access the page.
        withAcl: false,
    ),
],
```

**ACL Permissions**

- `jobs` User can access jobs
- `jobs.requeue` User can requeue jobs.

If using the [App Backend](https://github.com/tobento-ch/app-backend), you can assign the permissions in the roles or users page.

### Monitor Jobs Feature

[](#monitor-jobs-feature)

The monitor jobs feature records jobs using the job repository.

**Config**

In the [config file](#job-config) you can configure this feature:

```
'features' => [
    Feature\MonitorJobs::class,
],
```

Console
-------

[](#console)

### Purge Jobs Command

[](#purge-jobs-command)

Use the following command to purge monitored jobs:

**Purging jobs older than 24 hours**

```
php ap jobs:purge

```

**Available Options**

OptionDescription`--hours=24`The number of hours to retain jobs data.`--queued=true`If defined it purges only jobs which are queued (true) or not (false).`--status=failed`Purges only the jobs with the defined status.`--appId[]`Purges only the jobs which belongs to the defined app IDs.If you would like to automate this process, consider installing the [App Schedule](https://github.com/tobento-ch/app-schedule) bundle and using a command task:

```
use Tobento\Service\Schedule\Task;
use Butschster\CronExpression\Generator;

$schedule->task(
    new Task\CommandTask(
        command: 'jobs:purge',
    )
    // schedule task:
    ->cron(Generator::create()->daily())
);
```

Or you may install the [App Task](https://github.com/tobento-ch/app-task) bundle and use the [Command Task Registry](https://github.com/tobento-ch/app-task#command-task-registry) to register this command.

Learn More
----------

[](#learn-more)

### Monitor Jobs From Another App

[](#monitor-jobs-from-another-app)

When using different [Apps](https://github.com/tobento-ch/apps), you may monitor jobs from all apps. Make sure that you configure the same job repository connection in the [config file](#job-config).

For instance, you may use the [App Backend](https://github.com/tobento-ch/app-backend) and configure it like:

```
'features' => [
    Feature\Jobs::class,
    Feature\MonitorJobs::class,
],

'interfaces' => [
    JobRepositoryInterface::class =>
    static function(DatabasesInterface $databases, JobEntityFactory $entityFactory): JobRepositoryInterface {
        return new JobStorageRepository(
            storage: $databases->default('shared:storage')->storage()->new(),
            table: 'jobs',
            entityFactory: $entityFactory,
        );
    },
],
```

Next, if you have created another app:

```
'features' => [
    // only monitor jobs:
    Feature\MonitorJobs::class,
],

'interfaces' => [
    JobRepositoryInterface::class =>
    static function(DatabasesInterface $databases, JobEntityFactory $entityFactory): JobRepositoryInterface {
        return new JobStorageRepository(
            storage: $databases->default('shared:storage')->storage()->new(),
            table: 'jobs',
            entityFactory: $entityFactory,
        );
    },
],
```

Finally, in the [database config file](https://github.com/tobento-ch/app-database#database-config), in both apps, configure the `shared:storage` database:

```
'defaults' => [
    'pdo' => 'mysql',
    'storage' => 'file',
    'shared:storage' => 'shared:file',
],

'databases' => [
    'shared:file' => [
        'factory' => \Tobento\Service\Database\Storage\StorageDatabaseFactory::class,
        'config' => [
            'storage' => \Tobento\Service\Storage\JsonFileStorage::class,
            'dir' => directory('app:parent').'storage/database/file/',
        ],
    ],
],
```

Credits
=======

[](#credits)

- [Tobias Strub](https://www.tobento.ch)
- [All Contributors](../../contributors)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance75

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

Total

5

Last Release

136d ago

Major Versions

1.x-dev → 2.02025-10-06

PHP version history (2 changes)1.0.0PHP &gt;=8.0

2.0PHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/055d6a1b5c2384bb179c75ab0b55914231d898fdc4dffeb30770f81200e52206?d=identicon)[TOBENTOch](/maintainers/TOBENTOch)

---

Top Contributors

[![tobento-ch](https://avatars.githubusercontent.com/u/16684832?v=4)](https://github.com/tobento-ch "tobento-ch (7 commits)")

---

Tags

packagequeuejobapptobento

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tobento-app-job/health.svg)

```
[![Health](https://phpackages.com/badges/tobento-app-job/health.svg)](https://phpackages.com/packages/tobento-app-job)
```

PHPackages © 2026

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