PHPackages                             xentixar/workflow-manager - 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. xentixar/workflow-manager

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

xentixar/workflow-manager
=========================

A workflow manager plugin for FilamentPHP with PHP enum support.

2.0.1(6mo ago)106154MITPHP

Since Apr 22Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/xentixar/workflow-manager)[ Packagist](https://packagist.org/packages/xentixar/workflow-manager)[ RSS](/packages/xentixar-workflow-manager/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Workflow Manager for Laravel Filament
=====================================

[](#workflow-manager-for-laravel-filament)

[![banner](./banner.svg)](./banner.svg)

A workflow management package for Laravel Filament that lets you define and manage state transitions for your models using PHP enums, with optional per-transition conditions and interactive diagrams.

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

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Transition Conditions](#transition-conditions)
- [Workflow Diagram](#workflow-diagram)
- [Advanced](#advanced)
- [Examples](#examples)
- [Troubleshooting](#troubleshooting)

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

[](#requirements)

- **PHP** 8.1+
- **Laravel** 11.0+
- **Filament** 5.0+

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

[](#installation)

```
composer require xentixar/workflow-manager
```

Publish config and migrations:

```
php artisan vendor:publish --tag=workflow-manager-config
php artisan vendor:publish --tag=workflow-manager-migrations
```

Run migrations:

```
php artisan migrate
```

Configuration
-------------

[](#configuration)

After publishing, edit `config/workflow-manager.php`. All options are described below.

### `roles`

[](#roles)

Roles used to bind workflows to users. Each workflow is tied to one role; the StateSelect uses the same role to resolve the workflow.

```
'roles' => [
    'admin' => 'Admin',
    'user' => 'User',
    'manager' => 'Manager',
],
```

Use the **keys** (e.g. `'admin'`) when calling `StateSelect::make('status')->setRole('admin')` and when creating workflows in the admin.

---

### `include_parent`

[](#include_parent)

When **true**, reverse transitions are allowed: users can move back to the previous state(s). When **false**, only forward transitions (from state → to state) are allowed.

```
'include_parent' => true,
```

- **true**: Back arrows in the diagram; parent states appear in the state select.
- **false**: Strict one-way flow.

---

### `enable_policy`

[](#enable_policy)

When **true**, the package uses Laravel’s authorization (policy) for workflow management pages. When **false**, access is not gated by the policy.

```
'enable_policy' => true,
```

If enabled, ensure your auth setup (e.g. gates, Spatie Permission) grants the permissions listed under `permissions`.

---

### `navigation`

[](#navigation)

How the Workflow Manager appears in the Filament sidebar.

```
'navigation' => [
    'label' => 'State Workflows',   // Sidebar label
    'group' => 'Settings',          // Group name
    'sort' => "1",                   // Order within group
    'icon' => 'heroicon-o-arrows-right-left',
    'slug' => 'workflows',           // URL slug
],
```

---

### `permissions`

[](#permissions)

Permission names used by the workflow policy when `enable_policy` is true. Must match the names you register in your app (e.g. Gates or Spatie).

```
'permissions' => [
    'view_any' => 'view_any_workflow',
    'view' => 'view_workflow',
    'create' => 'create_workflow',
    'update' => 'update_workflow',
    'delete' => 'delete_workflow',
    'restore' => 'restore_workflow',
    'force_delete' => 'force_delete_workflow',
    'reorder' => 'reorder_workflow',
    'replicate' => 'replicate_workflow',
],
```

---

### `ignored_actions`

[](#ignored_actions)

Filament actions during which workflow validation is **skipped**: all state options are shown regardless of transitions and conditions. Useful for create (no current state) or replicate.

```
'ignored_actions' => [
    'create',
],
```

You can add more (e.g. `'replicate'`) or override per component with `setIgnoredActions()`.

---

### `rules_enabled`

[](#rules_enabled)

When **true**, per-transition conditions are evaluated: only transitions whose conditions pass are allowed, and the state select disables states that don’t pass. When **false**, conditions are ignored and all defined transitions are allowed.

```
'rules_enabled' => true,
```

Set to **false** to temporarily disable conditional logic without removing conditions.

---

Usage
-----

[](#usage)

### 1. Model setup

[](#1-model-setup)

Implement `WorkflowsContract` and use `HasWorkflows`. Return the enum class that defines states from `getStates()`.

```
