PHPackages                             davin-bao/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. davin-bao/workflow

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

davin-bao/workflow
==================

this is a workflow package for laravel5

v1.0.x-dev(9y ago)12626[1 issues](https://github.com/davin-bao/workflow/issues)MITPHPPHP &gt;=5.3.0

Since Aug 19Pushed 9y ago5 watchersCompare

[ Source](https://github.com/davin-bao/workflow)[ Packagist](https://packagist.org/packages/davin-bao/workflow)[ Docs](https://github.com/davin-bao/workflow)[ RSS](/packages/davin-bao-workflow/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Workflow (Laravel5 Package)
===========================

[](#workflow-laravel5-package)

### thanks tao2581, If you need use to laravel 4, please add

[](#thanks-tao2581-if-you-need-use-to-laravel-4-please-add)

```
"davin-bao/workflow": "v1.0"

```

Workflow package provides a simple way to add audit flow to **Laravel5**.

Quick start
-----------

[](#quick-start)

### Required setup

[](#required-setup)

In the `require` key of `composer.json` file add the following

```
"davin-bao/workflow": "dev-master"

```

Run the Composer update comand

```
$ composer update

```

In your `config/app.php` add `'DavinBao\Workflow\WorkflowServiceProvider'` to the end of the `$providers` array

```
'providers' => array(

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'DavinBao\Workflow\WorkflowServiceProvider',

),
```

At the end of `config/app.php` add `'Workflow'       => 'DavinBao\Workflow\WorkflowFacade'` to the `$aliases` array

```
'aliases' => array(

    'App'        => 'Illuminate\Support\Facades\App',
    'Artisan'    => 'Illuminate\Support\Facades\Artisan',
    ...
    'Workflow'       => 'DavinBao\Workflow\WorkflowFacade',

),
```

### Configuration

[](#configuration)

### Create Table

[](#create-table)

Now generate the Workflow migration

```
$ php artisan workflow:migration

```

It will generate the `_workflow_setup_tables.php` migration. You may now run it with the artisan migrate command: Open: `_workflow_setup_tables.php` change " {{ '&lt;?php' }} " to " &lt;?php " $ php artisan migrate

After the migration, workflow tables will be present.

### Create Controllers

[](#create-controllers)

```
$ php artisan workflow:controllers

```

### Create Routes

[](#create-routes)

```
$ php artisan workflow:routes

```

### Link the Model

[](#link-the-model)

```
    class Entry extends Eloquent {
      use \DavinBao\Workflow\HasFlowForResource;
    }
```

### Add two function for audit log,Audit Flow will record this resource's title and content

[](#add-two-function-for-audit-logaudit-flow-will-record-this-resources-title-and-content)

```
		public function getLogTitle()
		{
			return $this->entry_title;
		}

		public function getLogContent()
		{
			return $this->entry_content;
		}
```

### Link the Controller

[](#link-the-controller)

```
		class AdminEntryController extends AdminController {
				use \DavinBao\Workflow\HasFlowForResourceController;
		}
```

### Add roles for this controller

[](#add-roles-for-this-controller)

```
		Route::get('entrys/{entry}/binding', 'AdminEntrysController@getBindingFlow');
		Route::post('entrys/{entry}/binding', 'AdminEntrysController@postBindingFlow');
		Route::get('entrys/{entry}/audit', 'AdminEntrysController@getAudit');
		Route::post('entrys/{entry}/audit', 'AdminEntrysController@postAudit');
```

### Modify config

[](#modify-config)

Set the propertly values to the `config/auth.php` and `davin-bao/workflow/src/config/config.php` .

Functions
---------

[](#functions)

### Get is binding audit flow

[](#get-is-binding-audit-flow)

```
    if(isset($entry->isBinding)) {///is binding, do something }
```

### Get resource audit status

[](#get-resource-audit-status)

```
    $entry->status()
```

### Show flow Graph, show this resource audit flow status

[](#show-flow-graph-show-this-resource-audit-flow-status)

```
@if(isset($entry->isBinding))
{{ Workflow::makeFlowGraph($entry->flow(), $entry->orderID()) }}
@endif

```

### Show audit flow all details

[](#show-audit-flow-all-details)

```
 @if(isset($entry->isBinding))
{{ Workflow::makeAuditDetail($entry) }}
@endif

```

### Need I audit, show audit button

[](#need-i-audit-show-audit-button)

```
    if(isset($entry->isBinding) && $entry->isMeAudit()) { /// show audit button }
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.2% 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

Unknown

Total

1

Last Release

3557d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d4bcfd83f5b742d5aeddbc12fdcd74806a7b79d770b613a707fe49bc74cd3d9?d=identicon)[davin-bao](/maintainers/davin-bao)

---

Top Contributors

[![davin-bao](https://avatars.githubusercontent.com/u/5162830?v=4)](https://github.com/davin-bao "davin-bao (41 commits)")[![tao2581](https://avatars.githubusercontent.com/u/3303524?v=4)](https://github.com/tao2581 "tao2581 (15 commits)")

---

Tags

laravelworkflow

### Embed Badge

![Health badge](/badges/davin-bao-workflow/health.svg)

```
[![Health](https://phpackages.com/badges/davin-bao-workflow/health.svg)](https://phpackages.com/packages/davin-bao-workflow)
```

###  Alternatives

[zerodahero/laravel-workflow

Integerate Symfony Workflow component into Laravel.

204815.2k4](/packages/zerodahero-laravel-workflow)[brexis/laravel-workflow

Integerate Symfony Workflow component into Laravel.

283125.6k](/packages/brexis-laravel-workflow)[ringierimu/state-workflow

Laravel State Workflow provide tools for defining and managing workflows and activities with ease.

3251.1k](/packages/ringierimu-state-workflow)

PHPackages © 2026

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