PHPackages                             davispeixoto/workflow - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. davispeixoto/workflow

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

davispeixoto/workflow
=====================

A PHP package for managing state transitions

1.0.2(7y ago)05MITPHPPHP &gt;=7.1

Since Jan 23Pushed 7y agoCompare

[ Source](https://github.com/davispeixoto/workflow)[ Packagist](https://packagist.org/packages/davispeixoto/workflow)[ RSS](/packages/davispeixoto-workflow/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (8)Versions (4)Used By (0)

WorkflowInterface
=================

[](#workflowinterface)

A PHP package for dealing with state transitions.

[![Latest Stable Version](https://camo.githubusercontent.com/d0f71877dfd9e3b8456980f69ef80cb209a7b0453a5ae0f40f86c279151706cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6461766973706569786f746f2f776f726b666c6f772e737667)](https://packagist.org/packages/davispeixoto/workflow)[![Total Downloads](https://camo.githubusercontent.com/6bcb43e8c36990d08de74bf4f8f6c530e99d78c13dd73e834ecbaa1ecf7372e5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6461766973706569786f746f2f776f726b666c6f772e737667)](https://packagist.org/packages/davispeixoto/workflow)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/34a9e2a70c5e1eda503202ca08c85d1e1a636b6a47e1e1b9500a7a65fc1ebcfd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6461766973706569786f746f2f776f726b666c6f772f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/davispeixoto/workflow/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/6183b0cf3f51b6b90e74032ece85a381276ee2aa38598492adc57a2f510d99d5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6461766973706569786f746f2f776f726b666c6f772f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/davispeixoto/workflow/?branch=master)[![Build Status](https://camo.githubusercontent.com/d4831a853b27f3963e91be8cf1f3be8dfe9b1220151e9c1a40b84a70a2bfa2de/68747470733a2f2f7472617669732d63692e6f72672f6461766973706569786f746f2f776f726b666c6f772e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/davispeixoto/workflow)

State transitions are a good way to manage lifecycles and pipelines on applications, as for example:

- Order and payment status on an e-commerce
- Invoice Status on a finance system
- Ticket Status on ticket service desk system
- Sales status on a CRM

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

[](#installation)

The workflow package can be installed via [Composer](http://getcomposer.org) by requiring the `davispeixoto/workflow` package in your project's `composer.json`.

```
{
    "require": {
        "davispeixoto/workflow": "~1.0"
    }
}
```

Or

```
$ php composer.phar require davispeixoto/workflow
```

And running a composer update from your terminal:

```
php composer.phar update
```

Usage
-----

[](#usage)

To use it, first you need to create the status you are going to use for representing your states.

```
