PHPackages                             cboxdk/laravel-operations - 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. cboxdk/laravel-operations

ActiveLibrary

cboxdk/laravel-operations
=========================

Durable, multi-step operations for Laravel — a strict state machine with per-step progress, idempotent retries, and a stall sweep.

v0.1.0(1mo ago)11MITPHPPHP ^8.4CI passing

Since Jul 15Pushed 1mo agoCompare

[ Source](https://github.com/cboxdk/laravel-operations)[ Packagist](https://packagist.org/packages/cboxdk/laravel-operations)[ RSS](/packages/cboxdk-laravel-operations/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (11)Versions (2)Used By (0)

Cbox Operations
===============

[](#cbox-operations)

Durable, multi-step operations for Laravel — the operations engine behind long-running background work. Track a deploy, a provisioning run, or an import as a first-class record with a **strict state machine**, **per-step progress**, **idempotent retries**, and a **stall sweep** — instead of a black-box job.

```
use Cbox\Operations\Contracts\Operations;
use Cbox\Operations\DataObjects\{StartOperation, AdvanceStep, CompleteOperation};

$operations = app(Operations::class);

$op = $operations->start(new StartOperation(
    kind: 'deploy',
    targetType: 'workload',
    targetId: 'wl_123',
    steps: ['build', 'release', 'route'],
    expiresAt: now()->addMinutes(15),   // stalls after this → swept to failed
));

$operations->advanceStep(new AdvanceStep($op->id, 'build'));   // build done, release starts
$operations->advanceStep(new AdvanceStep($op->id, 'release'));
$operations->advanceStep(new AdvanceStep($op->id, 'route'));
$operations->complete(new CompleteOperation($op->id));
```

Every change dispatches an `OperationUpdated` event, so a client can watch progress live without polling. Re-running a step or a completion is a safe no-op (at-least-once workers never double-apply).

Why
---

[](#why)

Background work that spans several steps usually collapses to a single job with no visible progress and no way to tell "stuck" from "slow". Cbox Operations gives that work an auditable status (`pending → running → completed | failed`), per-step timing, and a deadline so a crashed worker self-heals into a terminal `failed` rather than a stuck `running` forever.

Install
-------

[](#install)

```
composer require cboxdk/laravel-operations
php artisan migrate
```

Schedule the stall sweep so past-deadline operations self-heal:

```
Schedule::command('operations:sweep-stalled')->everyMinute();
```

Design
------

[](#design)

- **Contracts-first.** Depend on `Cbox\Operations\Contracts\Operations`, never the concrete manager — so you can decorate it and tests can swap the bundled fake.
- **Deny-by-default state machine.** Illegal transitions throw; terminal states never move.
- **Tenancy-agnostic.** `tenant_id` is an optional column the package simply persists — bring your own scoping.
- **Broadcast-agnostic.** `OperationUpdated` is a plain event; wire it to your own transport if you want live UI.
- **Dogfooded testing.** Ship `InteractsWithOperations` + `FakeOperations` and use them in your own suite:

    ```
    $ops = $this->fakeOperations();
    $this->deploy('wl_123');
    $ops->assertStarted('deploy');
    ```

Documentation
-------------

[](#documentation)

Full docs live in [`/docs`](docs/index.md): quickstart, architecture, the state machine, cookbook recipes, extension points, and the security/scope notes.

License
-------

[](#license)

MIT © Cbox

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

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

---

Tags

cboxlaraveloperationsprocess-managersagastate-machineworkflowlaravelworkflowstate-machineoperationsprocess managersagacbox

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/cboxdk-laravel-operations/health.svg)

```
[![Health](https://phpackages.com/badges/cboxdk-laravel-operations/health.svg)](https://phpackages.com/packages/cboxdk-laravel-operations)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3365.5M359](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k17.6M165](/packages/laravel-pulse)[laravel/ai

The official AI SDK for Laravel.

1.1k6.4M360](/packages/laravel-ai)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k31.8M166](/packages/laravel-cashier)[illuminate/queue

The Illuminate Queue package.

20433.5M1.9k](/packages/illuminate-queue)[spatie/laravel-health

Monitor the health of a Laravel application

89313.5M195](/packages/spatie-laravel-health)

PHPackages © 2026

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