Laravel Approvals
Approval workflows for Eloquent models: capture a pending change as a Modification, gate it behind N approvers/disapprovers, and apply the diff once approved.
Modification is the single source of change history and approval flow for a model. A direct update is recorded as an applied, informational Modification; an update that requires authorization is captured as a pending one and applied only once it clears its approval threshold.
Contents
- Getting Started — installation and the minimal setup for a gated model and an approver model.
- Modification & History — how
flow/statusmodel history, and the stored diff format. - Partial (Per-Item) Approval — opting a model into independently-decidable field groups via
ModificationItem. - Recording Manual Events —
recordModification()for history outside ofsaving(attachments, signatures, integrations). - API Reference — extension points, config, known limitations.
- Upgrading — migrating an existing installation to the
flow/status/ModificationItemmodel. - Changelog
Requirements
- PHP 8.2+
-
illuminate/database/illuminate/support^11^12
Installation
composer require reynotech/laravel-approvals
php artisan vendor:publish --tag=approvals-migrations
php artisan migrate
Optionally publish the config:
php artisan vendor:publish --tag=approvals-config
Source on GitHub: reynotech/laravel-approvals