PHPackages                             xplodman/filamentapproval - 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. xplodman/filamentapproval

ActiveLibrary[Admin Panels](/categories/admin)

xplodman/filamentapproval
=========================

A Filament plugin for approval / moderation of create/edit/delete operations.

v1.0.6(6mo ago)111MITPHPPHP ^8.1CI passing

Since Oct 21Pushed 6mo agoCompare

[ Source](https://github.com/xplodman/FilamentApproval)[ Packagist](https://packagist.org/packages/xplodman/filamentapproval)[ Docs](https://github.com/xplodman/filamentapproval)[ GitHub Sponsors](https://github.com/Xplodman)[ RSS](/packages/xplodman-filamentapproval/feed)WikiDiscussions main Synced 1mo ago

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

FilamentApproval
================

[](#filamentapproval)

[![Latest Version on Packagist](https://camo.githubusercontent.com/912385359f614aaedb5fb2fed624d9e55fb3222bdf4508ac2c570962f2fcd4b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f78706c6f646d616e2f66696c616d656e74617070726f76616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xplodman/filamentapproval)[![Total Downloads](https://camo.githubusercontent.com/815070f2042658ba4e6228e6269f7b132c9f9476277c3815145170dfdfa898b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f78706c6f646d616e2f66696c616d656e74617070726f76616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xplodman/filamentapproval)[![GitHub Tests](https://camo.githubusercontent.com/a667f9430ae57791c8d70b733bf78fa8caa13ff12ec7f89481cc6ea4fd03876a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f78706c6f646d616e2f66696c616d656e74617070726f76616c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/xplodman/filamentapproval/actions)[![License](https://camo.githubusercontent.com/b3bf3bd58412a6f909435ec32eef8b919217e46ff088baa04cbac4a8063d7cf7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f78706c6f646d616e2f66696c616d656e74617070726f76616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xplodman/filamentapproval)

A powerful Filament plugin that adds approval workflows to your create, edit, and delete operations. Perfect for content moderation, administrative oversight, and maintaining data integrity in your Filament applications.

✨ Features
----------

[](#-features)

- 🔄 **Complete CRUD Approval** - Intercept create, edit, and delete operations
- 🎯 **Easy Integration** - Simple traits to add to your existing Filament resources
- 👥 **User-Friendly** - Clear notifications and intuitive approval interface
- 🔐 **Permission-Based** - Configurable bypass permissions for administrators
- 📊 **Rich Management** - Comprehensive approval request management interface
- 🎨 **Filament Native** - Built specifically for Filament v4 with modern UI components
- 🔍 **Detailed Tracking** - Track changes, original data, and approval history
- ⚡ **Performance Optimized** - Efficient database queries and indexing

🚀 Installation
--------------

[](#-installation)

You can install the package via Composer:

```
composer require xplodman/filamentapproval

```

### Publish Configuration and Migrations

[](#publish-configuration-and-migrations)

Publish the configuration file:

```
php artisan vendor:publish --tag="filamentapproval-config"

```

Publish and run the migrations:

```
php artisan vendor:publish --tag="filamentapproval-migrations"
php artisan migrate

```

### Register the Plugin

[](#register-the-plugin)

Add the plugin to your Filament panel provider:

```
// app/Providers/Filament/AdminPanelProvider.php
use Filament\Panel;
use Filament\PanelProvider;
use Xplodman\FilamentApproval\FilamentApprovalPlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            ->plugins([
                FilamentApprovalPlugin::make(),
            ]);
    }
}

```

⚙️ Configuration
----------------

[](#️-configuration)

The package comes with a comprehensive configuration file at `config/filamentapproval.php`:

```
return [
    /*
    |--------------------------------------------------------------------------
    | User Model
    |--------------------------------------------------------------------------
    |
    | The user model class that will be used for relationships in the
    | approval requests. This should match your application's user model.
    |
    */
    'user_model' => config('auth.providers.users.model', 'App\Models\User'),

    /*
    |--------------------------------------------------------------------------
    | Approval Request Model
    |--------------------------------------------------------------------------
    |
    | The model class that will be used for approval requests.
    | You can override this to use a custom model (e.g., MongoDB model).
    |
    */
    'approval_request_model' => \Xplodman\FilamentApproval\Models\ApprovalRequest::class,

    /*
    |--------------------------------------------------------------------------
    | Navigation Group
    |--------------------------------------------------------------------------
    |
    | The navigation group where the approval requests resource will appear
    | in the Filament admin panel.
    |
    */
    'navigation_group' => 'Management',

    /*
    |--------------------------------------------------------------------------
    | Navigation Icon
    |--------------------------------------------------------------------------
    |
    | The icon that will be displayed next to the approval requests resource
    | in the Filament admin panel navigation.
    |
    */
    'navigation_icon' => 'heroicon-o-clipboard-document-check',

    /*
    |--------------------------------------------------------------------------
    | Auto Register Resource
    |--------------------------------------------------------------------------
    |
    | Whether to automatically register the ApprovalRequestResource with
    | Filament panels. Set to true if you want automatic registration.
    | For most cases, you should manually register it in your panel.
    |
    */
    'auto_register_resource' => false,

    /*
    |--------------------------------------------------------------------------
    | Debug Mode
    |--------------------------------------------------------------------------
    |
    | Enable debug mode to show detailed debug information in the diff view.
    | This includes raw values, cast types, normalization details, and
    | comparison logic information for troubleshooting.
    |
    */
    'debug' => false,

    /*
    |--------------------------------------------------------------------------
    | Permissions
    |--------------------------------------------------------------------------
    |
    | Configure the permission names used for approving and rejecting
    | approval requests. These should match the permissions created by
    | your authorization layer (e.g., Filament Shield + Spatie Permission).
    |
    */
    'permissions' => [
        // Set to null to bypass explicit permission checks and allow based on policy or open access.
        // To enforce permissions (e.g., with Filament Shield + Spatie Permission), set your keys here
        // and add the same keys to Shield's `custom_permissions` before generating.

        'approve' => null,  // e.g., 'approve_approval_requests'
        'reject' => null,   // e.g., 'reject_approval_requests'
        'bypass' => null,   // e.g., 'bypass_approval_requests'
    ],
];

```

📖 Usage
-------

[](#-usage)

### 1. Create Operations

[](#1-create-operations)

Add the `InterceptsCreateForApproval` trait to your create page:

```
