PHPackages                             czim/laravel-processor - 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. [Framework](/categories/framework)
4. /
5. czim/laravel-processor

ActiveLibrary[Framework](/categories/framework)

czim/laravel-processor
======================

Pipelined processor framework for Laravel.

1.2.0(5y ago)24.2k1MITPHPPHP ^7.1|^8.0

Since Oct 2Pushed 5y ago2 watchersCompare

[ Source](https://github.com/czim/laravel-processor)[ Packagist](https://packagist.org/packages/czim/laravel-processor)[ Docs](https://github.com/czim/laravel-processor)[ RSS](/packages/czim-laravel-processor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (14)Used By (1)

Laravel Pipeline Processor
==========================

[](#laravel-pipeline-processor)

[![Latest Version on Packagist](https://camo.githubusercontent.com/384612934962eade87dea5e399563537bd1a7d6bd8658e26240720c698fb901d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f637a696d2f6c61726176656c2d70726f636573736f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/czim/laravel-processor)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/67fab6c7829f05ad340c5c68181e60f68851e68d38655de4c74175cddc82b57a/68747470733a2f2f7472617669732d63692e6f72672f637a696d2f6c61726176656c2d70726f636573736f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/czim/laravel-processor)[![Latest Stable Version](https://camo.githubusercontent.com/a0b2260a67350ac302a584200e21df21ab466458ba4c1d0da4551a1260bce921/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f637a696d2f6c61726176656c2d70726f636573736f722e737667)](https://packagist.org/packages/czim/laravel-processor)[![SensioLabsInsight](https://camo.githubusercontent.com/697a04bccdd7cc4a56c820f75d327abdf7ab02c72f10fb0557fb2d46cf472d34/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37656534643462382d396530342d343566302d623561642d3561656565363065393264362f6d696e692e706e67)](https://insight.sensiolabs.com/projects/7ee4d4b8-9e04-45f0-b5ad-5aeee60e92d6)

Framework for building modular, pipelined data processors.

The idea behind this is to have a configurable, clean and testable setup for complex data processing. It carries a lot of overhead, of course, so this only makes sense for fairly demanding (background) processing.

Usage example: This was constructed to better handle extensive product and debtor datasheet imports for a particular project. The imported data is converted to a relational database structure spanning many tables. Using pipelined processing, this can be done in discrete, separately testable process step classes that each have their own responsibility.

Install
-------

[](#install)

Via Composer

```
$ composer require czim/laravel-processor
```

Usage
-----

[](#usage)

Extend `Czim\PipelineProcessor` (or `Czim\AbstractProcessor`) and write implementations for the abstract methods.

Processing is done by calling the `process()` method on your class. The parameter for this method must be an implementation of `Czim\DataObject\Contracts\DataObjectInterface`(see the [czim\\laravel-dataobject](https://github.com/czim/laravel-dataobject) for more information).

```

    $processor = new Your\Processor();

    $data = new Your\DataObject($someData);

    $result = $processor->process($data);

    if ( ! $result->success) {
        ...
    }
```

The returned result is an instance of `Czim\Processor\DataObjects\ProcessorResult`. This is a DataObject with a boolean `success` property, as well as `warnings` and `errors` MessageBags by default.

### Pipeline Processor

[](#pipeline-processor)

A pipeline processor consists of a series of process steps, which are executed in sequence.

A process context is passed into the pipeline and from step to step. It contains the data to be processed, cache, settings and such and its contents may be modified to affect the way subsequent steps behave.

When exceptions are thrown, the pipeline ends and the remaining steps are not executed.

To use it, extend `Czim\PipelineProcessor` and add the following to your class:

```
    /**
     * @return array
     */
    protected function processSteps()
    {
        // Set a series of process step classnames and return it
        // these steps must extend Czim\Processor\Steps\AbstractProcessStep
        // or otherwise implement Czim\Processor\Contracts\ProcessStepInterface
        return [
            Your\ProcessSteps\ClassNameHere::class,
            Your\ProcessSteps\AnotherClassNameHere::class,
        ];
    }
```

For more configuration options, see [the PipelineProcessor source](https://github.com/czim/laravel-processor/blob/master/src/PipelineProcessor.php).

#### Process Steps

[](#process-steps)

Process steps can extend `Czim\Processor\Steps\AbstractProcessStep` and implement the `process()` method:

```
    protected function process()
    {
        // Define your custom processing here.
        // The data object can be accessed through $this->data
        // and the process context through $this->context
    }
```

#### Process Context

[](#process-context)

A ProcessContext is an instance that represents the context in which the pipeline steps take place. It stores the data passed into the `process()` method. It can also store settings and a cache.

A `ContextRepositoryTrait` for your own extensions is also provided, in case you want to store repositories with the [czim\\laravel-repository](https://github.com/czim/laravel-repository) package in the context.

#### Database Transaction

[](#database-transaction)

By default, the (main) pipeline is executed in a database transaction; it is comitted on succesfully completing all the steps, and rolled back on any exception thrown.

To run the process without a database transaction, set the following property in your `PipelineProcessor` extension:

```
    protected $databaseTransaction = false;
```

### Simple Processor

[](#simple-processor)

If a pipeline is overkill, you can also use a simpler approach.

Extend `Czim\AbstractProcessor` and add the following to your class:

```
    protected function doProcessing()
    {
        // Define your custom processing here.
        // The data object can be accessed through $this->data

        // The result data object that will be returned can
        // be modified through $this->result
    }
```

For more configuration options, see [the AbstractProcessor source](https://github.com/czim/laravel-processor/blob/master/src/AbstractProcessor.php).

To Do
-----

[](#to-do)

- Make App/Container injectable, remove dependency on laravel's app() function

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Coen Zimmerman](https://github.com/czim)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity75

Established project with proven stability

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

Recently: every ~458 days

Total

12

Last Release

1845d ago

PHP version history (3 changes)1.0.0PHP &gt;=5.4.0

1.1.3PHP &gt;=5.6.0

1.2.0PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1657b09521b6030fe32d864a493ded8b1dbbdf737ef3772135dfc123cea34767?d=identicon)[czim](/maintainers/czim)

---

Top Contributors

[![czim](https://avatars.githubusercontent.com/u/11831617?v=4)](https://github.com/czim "czim (14 commits)")

---

Tags

laravelpipeline-processorprocessingprocessorpipelinedata processingmodular processingprocess step

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/czim-laravel-processor/health.svg)

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

###  Alternatives

[livewire/livewire

A front-end framework for Laravel.

23.5k75.5M1.8k](/packages/livewire-livewire)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[laravel/cashier

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

2.5k25.9M107](/packages/laravel-cashier)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k49.4M479](/packages/laravel-scout)[laravel/pulse

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

1.7k12.1M99](/packages/laravel-pulse)[laravel/pennant

A simple, lightweight library for managing feature flags.

57711.1M53](/packages/laravel-pennant)

PHPackages © 2026

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