Download the PHP package wezlo/filament-approval without Composer

On this page you can find all versions of the php package wezlo/filament-approval. 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 filament-approval

Filament Approval Workflow Engine

A configurable approval workflow package for Filament. Attach approval chains to any Eloquent model with single, sequential, or parallel approvers, SLA timers, escalation rules, delegation, and a full audit trail.

Requirements

Features

Installation

Publish and run migrations:

Ensure you have a notifications table (required for Filament database notifications):

Register the plugin in your Panel Provider:

You can override resolvers, user model, and navigation group per-panel:

Resolution order: plugin override (per-panel) > config file (global) > default fallback.

You can also disable the flow resource or widgets per-panel:

Publish the config (optional):

Quick Start

1. Add the trait to your model

This gives you:

2. Add approval actions to your resource page

This adds five context-aware actions to the page header:

3. Add the status column to your table

Displays a colored badge: Pending (warning), Approved (success), Rejected (danger), Cancelled (gray).

4. Add approval history to your resource

Relation Manager -- full approval history tab on View/Edit pages:

This adds an "Approvals" tab showing all approval instances. Clicking "View" on any row opens a slide-over with:

Infolist Section -- current approval at a glance on View pages:

Shows a collapsible section with:

The section auto-hides when there's no approval on the record.

5. Create an approval flow

Navigate to the Approvals > Approval Flows resource in your Filament panel. Create a flow with:

Approval Flow Types

Single

One approver, one approval required. The simplest flow.

Sequential

Multiple steps executed in order. Step 2 doesn't activate until step 1 is approved. A rejection at any step rejects the entire approval and skips remaining steps.

Parallel

Multiple approvers on a single step. Configure required_approvals to set how many must approve (e.g., 2-of-3). The step completes when the threshold is met.

Approver Resolvers

Resolvers determine who can approve each step. Three are included:

UserResolver

Assigns specific users by ID:

RoleResolver

Assigns all users with a given Spatie role. When multi-tenancy is enabled, approvers are scoped to the approvable model's tenant:

CallbackResolver

Register named callbacks in your service provider for custom logic:

Then select "Custom Callback" as the approver type in the flow builder.

Custom Resolvers

Implement the ApproverResolver contract:

Register it in config/filament-approval.php:

SLA & Escalation

Configure SLA on any step in the flow builder:

The approval:process-sla command runs every minute (configurable) and:

  1. Sends SLA warnings at 75% of the deadline (configurable threshold)
  2. Processes escalations when the deadline is breached

The command is auto-scheduled by the package. To disable:

Delegation

Any assigned approver can delegate their approval authority to another user. The delegate can then approve or reject on their behalf. Delegations are recorded in the audit trail.

Submission Policy

By default, any authenticated user can submit any record for approval, and re-submission is allowed after approval or rejection. Override these methods on your model to customize:

One-time approval (no re-submission)

Restrict who can submit

Combine both

The canBeSubmittedForApproval() method combines all checks (pending status + resubmission policy + user authorization) and is used by the Submit action's visibility logic.

Audit Trail

Every action is recorded in the approval_actions table:

Access the audit trail:

Notifications

The package sends Filament database notifications for:

Dashboard Widgets

The plugin registers two widgets:

PendingApprovalsWidget

A table showing the current user's pending approvals with step name, record reference, time waiting, and SLA status. Overdue items are highlighted in red.

ApprovalAnalyticsWidget

Stats overview with:

Disable widgets:

Disable the flow resource:

Blade Components

The package includes Blade components for custom views:

Publish views:

Events & Model Callbacks

There are two ways to react to approval lifecycle events: Laravel events (for decoupled listeners) and model callbacks (for logic that belongs on the model itself).

Laravel Events

Listen to these events via event listeners or subscribers:

Each event carries the relevant Approval or ApprovalStepInstance model.

Model Lifecycle Callbacks

Override these methods on any model using HasApprovals to react directly on the model:

All callbacks are optional -- only override the ones you need. They are called after the action has been persisted to the database.

Callback When it fires Arguments
onApprovalSubmitted Model submitted for approval Approval
onApprovalApproved All steps approved Approval
onApprovalRejected Rejected at any step Approval
onApprovalCancelled Approval cancelled Approval
onApprovalCommented Comment added ApprovalAction
onApprovalDelegated Approver delegates ApprovalStepInstance, $fromUserId, $toUserId
onApprovalStepCompleted Individual step approved ApprovalStepInstance
onApprovalEscalated SLA breached ApprovalStepInstance

Programmatic Usage

Use the ApprovalEngine service directly:

Multi-Tenancy

Multi-tenancy is disabled by default. When enabled, approval flows are scoped per tenant and the tenant column is added to the approval_flows migration.

Enable it in config/filament-approval.php:

When scope_approvers is true, the RoleResolver will only return users that share the same tenant as the approvable model.

Important: Configure multi-tenancy before running migrations. The tenant column is only added to the approval_flows table when multi_tenancy.enabled is true.

Configuration

Translations

The package ships with English and Arabic translations. All UI strings (labels, messages, notifications, enum values) are fully translated.

Publish translations to customize:

This copies the language files to lang/vendor/filament-approval/. The translation file is organized by section:

To add a new language, create lang/vendor/filament-approval/{locale}/approval.php with the same structure.

Custom Theme

If you have a custom Filament theme, add the package views to your @source directive:

Testing

License

MIT


All versions of filament-approval with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^4.0 || ^5.0
spatie/laravel-package-tools Version ^1.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 wezlo/filament-approval contains the following files

Loading the files please wait ...