Download the PHP package jodeveloper/approval-flow without Composer
On this page you can find all versions of the php package jodeveloper/approval-flow. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jodeveloper/approval-flow
More information about jodeveloper/approval-flow
Files in jodeveloper/approval-flow
Package approval-flow
Short Description A Laravel package for managing approval workflows with enums and traits
License MIT
Homepage https://github.com/jodeveloper/approval-flow
Informations about the package approval-flow
Nakhlah Approval Flow
A powerful Laravel package for managing approval workflows using PHP 8.1+ enums and traits. Create complex approval processes with ease!
Features
- ✅ Type-safe approval flows using PHP 8.1 enums
- ✅ Reusable trait for any Eloquent model
- ✅ Permission-based approvals with Laravel's authorization system
- ✅ Event-driven architecture for notifications and logging
- ✅ Automatic activity logging with user tracking
- ✅ Bulk approval operations
- ✅ Artisan command to generate approval flow enums
- ✅ Comprehensive testing with Pest
Installation
You can install the package via composer:
You can publish and run the migrations with:
You can publish the config file with:
Quick Start
1. Create an Approval Flow Enum
Generate a new approval flow enum:
This creates app/Enums/DocumentStatuses.php:
2. Add the Trait to Your Model
3. Use in Controllers
Usage Examples
Basic Approval Operations
Bulk Operations
Approval Statistics
Event Handling
The package fires events that you can listen to:
Create listeners:
Approval History
Custom Status Transitions
For simple status changes that don't require approval workflow:
When to use getStatusTransitions():
- ✅ Automatic transitions (system-triggered)
- ✅ Simple state changes (no approval needed)
- ✅ Performance optimization (bypass permission checks)
- ✅ Fallback transitions (when approval flow not applicable)
When to use getApprovalFlow():
- ❌ Permission-based approvals
- ❌ Multi-step workflows
- ❌ User-triggered transitions
- ❌ Audit trails required
Advanced Configuration
Custom Approval Log Model
If you want to extend the approval logging functionality:
Then update your config:
Disable Logging
Testing
Package Structure
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.
Credits
- jodeveloper
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of approval-flow with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0|^11.0|^12.0