PHPackages                             a909m/filament-statefusion - 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. [Admin Panels](/categories/admin)
4. /
5. a909m/filament-statefusion

ActiveLibrary[Admin Panels](/categories/admin)

a909m/filament-statefusion
==========================

Filament StateFusion is a powerful FilamentPHP plugin that seamlessly integrates Spatie Laravel Model States into the Filament admin panel. This package provides an intuitive way to manage model states, transitions, and filtering within Filament, enhancing the user experience and developer productivity.

v2.3.0(4mo ago)3010.8k↓31.1%4[1 issues](https://github.com/A909M/Filament-StateFusion/issues)[3 PRs](https://github.com/A909M/Filament-StateFusion/pulls)1MITPHPPHP ^8.2CI passing

Since Jul 31Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/A909M/Filament-StateFusion)[ Packagist](https://packagist.org/packages/a909m/filament-statefusion)[ Docs](https://github.com/a909m/filament-statefusion)[ GitHub Sponsors](https://github.com/A909M)[ RSS](/packages/a909m-filament-statefusion/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (19)Used By (1)

[![Description](images/StateFusion.png)](images/StateFusion.png)

Filament-StateFusion
====================

[](#filament-statefusion)

**Brings the full power of Spatie Laravel Model States to Filament with zero complexity and beautiful visual workflows.**

[![Latest Version on Packagist](https://camo.githubusercontent.com/512bc7da05d939e7e85120d4739d898aac8be4ba14986dc3f252e0fad8925a5a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f613930396d2f66696c616d656e742d7374617465667573696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/a909m/filament-statefusion)[![GitHub Tests Action Status](https://camo.githubusercontent.com/524fdca088561169f825eec14c8a03955378e8da5c8dda6fdd842fd860d730bb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f613930396d2f66696c616d656e742d7374617465667573696f6e2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/a909m/filament-statefusion/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/e4a97b91aa966446e43746b8f3461c2c5af3636465dc50a0bfb8ec7dd503b553/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f613930396d2f66696c616d656e742d7374617465667573696f6e2f6669782d7068702d636f64652d7374796c696e672e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/a909m/filament-statefusion/actions?query=workflow%3A%22Fix+PHP+code+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/c8c0a203f988d4464a15d9c849e62fce468969c47936cdc13eb979f0336b9262/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f613930396d2f66696c616d656e742d7374617465667573696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/a909m/filament-statefusion)

**Filament StateFusion** is a powerful [FilamentPHP](https://filamentphp.com/) plugin that seamlessly integrates [Spatie Laravel Model States](https://spatie.be/docs/laravel-model-states) into the Filament admin panel. Effortlessly manage model states, transitions, and filtering within Filament, enhancing both user experience and developer productivity.

Perfect for order processing, publishing workflows, approval systems, and any application requiring well-defined state management.

---

Features
--------

[](#features)

✨ **Rich State Management**

- Display model states in tables with colors, icons, and descriptions
- Filter and group records by state
- Transition between states using intuitive UI components
- Bulk state transitions with validation

🛠 **Developer Experience**

- Out-of-the-box support for [Spatie Laravel Model States](https://spatie.be/docs/laravel-model-states)
- Custom transition forms for collecting additional data
- Automatic state validation and transition rules
- Compatible with Filament v4 dark mode

🎨 **Customizable Interface**

- Custom labels, colors, icons, and descriptions for states
- Custom transition forms and validation
- Flexible attribute mapping for complex models

---

🎬 Preview
---------

[](#-preview)

> 📸 *Screenshots and demo GIFs will be added soon*

---

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

[](#requirements)

This plugin is designed to work with the following dependencies:

- PHP: ^8.1
- Laravel: ^10.0|^11.0|^12.0
- Filament: ^3.0|^4.0|^5.0
- Spatie Laravel Model States: ^2.0

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

[](#installation)

Install the package via Composer:

Plugin VersionFilament VersionReadme1.x3.x[Link](https://github.com/A909M/Filament-StateFusion/blob/v1.x/README.md)2.x4.x5.x```
composer require a909m/filament-statefusion
```

### Upgrading to Filament v4

[](#upgrading-to-filament-v4)

- `composer require a909m/filament-statefusion:2.0`
- The Action classes were simplified into a single `StateFusionBulkAction` and `StateFusionAction` for pages and tables

Then, implement the `HasFilamentStateFusion` interface and use the `StateFusionInfo` trait on your abstract state class.

Finally, you can start using the components and actions provided by this plugin in your Filament resources.

---

Understanding State Management
------------------------------

[](#understanding-state-management)

This plugin builds on [Spatie Laravel Model States](https://spatie.be/docs/laravel-model-states), which provides:

- **State Classes**: Each state is a separate class with its own behavior and logic
- **State Transitions**: Define which state changes are allowed (e.g., `Pending` → `Processing`)
- **Transition Classes**: Optional classes for complex transitions that need additional data or logic
- **Type Safety**: Your IDE knows which states and methods are available

Example: An order can be `Pending`, `Processing`, `Shipped`, or `Cancelled`. You define:

- Which transitions are valid (`Pending` can become `Processing`, but `Shipped` cannot become `Pending`)
- What happens during each transition (send emails, update timestamps, etc.)

**StateFusion makes these states visual and interactive in Filament** with dropdowns, badges, filters, and action buttons.

---

Getting Started
---------------

[](#getting-started)

### 1. Prepare Your State Classes

[](#1-prepare-your-state-classes)

First, ensure you have [Spatie Laravel Model States](https://spatie.be/docs/laravel-model-states) configured. Then implement the `HasFilamentStateFusion` interface and use the `StateFusionInfo` trait on your **abstract state class**:

```
