Download the PHP package xplodman/filamentapproval without Composer

On this page you can find all versions of the php package xplodman/filamentapproval. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filamentapproval

FilamentApproval

Latest Version on Packagist Total Downloads GitHub Tests License

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

๐Ÿš€ Installation

You can install the package via Composer:

Publish Configuration and Migrations

Publish the configuration file:

Publish and run the migrations:

Register the Plugin

Add the plugin to your Filament panel provider:

โš™๏ธ Configuration

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

๐Ÿ“– Usage

1. Create Operations

Add the InterceptsCreateForApproval trait to your create page:

2. Edit Operations

Add the InterceptsEditForApproval trait to your edit page:

3. Resource Configuration

Update your resource to use the approval-enabled pages:

4. Relationship Handling

If your model has relationships that need to be handled during approval, define the approvalRelations() method in your resource. This method tells the package how to handle different relationship types during the approval process.

Available Relation Types

The package supports the following relationship types via RelationTypeEnum:

Example Usage

5. Approval Request Resource

By default, the approval request resource is not automatically registered. You have two options:

Option 1: Enable Auto Registration

Set auto_register_resource to true in your config:

Option 2: Manual Registration (Recommended)

Keep auto_register_resource as false and manually register the resource in your panel:

6. Permissions Setup

With Filament Shield

If using Filament Shield, add these permissions to your custom_permissions:

Then update your config:

With Spatie Permission

๐Ÿ—„๏ธ Database Schema

The package creates an approval_requests table with the following structure:

Column Type Description
id ULID Primary key
request_type String Type of request (create, edit, delete)
requester_id BigInt ID of the user who made the request
approvable_type String The model class being approved
approvable_id ULID ID of the specific model instance
attributes JSON Model attributes data
relationships JSON Relationship data (for future use)
original_data JSON Original values (for edit requests)
resource_class String Filament resource class for form rendering
status String Current status (pending, approved, rejected)
decided_by_id BigInt ID of the user who made the decision
decided_reason Text Optional reason for the decision
decided_at Timestamp When the decision was made
created_at, updated_at, deleted_at Timestamps Standard Laravel timestamps

๐Ÿ”„ How It Works

Create Flow

  1. User submits a create form
  2. Form data is captured and stored in approval_requests table
  3. Actual record creation is prevented
  4. User receives notification that request is pending approval
  5. Administrator reviews and approves/rejects the request
  6. If approved, the actual model is created with the captured data

Edit Flow

  1. User modifies a record and saves
  2. Changes are detected and compared with original data
  3. An approval request is created with the proposed changes
  4. Original record remains unchanged
  5. Administrator reviews the changes
  6. If approved, changes are applied to the original record

Delete Flow

  1. User attempts to delete a record
  2. Delete action is intercepted
  3. An approval request is created for the deletion
  4. Record remains in the database
  5. Administrator reviews the deletion request
  6. If approved, the record is actually deleted

๐ŸŽจ User Experience

๐Ÿงช Testing

Run the test suite:

๐Ÿ“ Changelog

Please see CHANGELOG for more information on what has changed recently.

๐Ÿค Contributing

Please see CONTRIBUTING for details.

๐Ÿ”’ Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

๐Ÿ“„ License

The MIT License (MIT). Please see License File for more information.

๐Ÿ™ Credits


Made with โค๏ธ for the Filament community


All versions of filamentapproval with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
filament/filament Version ^4.0
spatie/laravel-package-tools Version ^1.15.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package xplodman/filamentapproval contains the following files

Loading the files please wait ...