Download the PHP package litepie/flow without Composer
On this page you can find all versions of the php package litepie/flow. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package flow
Short Description A powerful Laravel package for workflow management with states and transitions
License MIT
Homepage https://github.com/litepie/flow
Informations about the package flow
Litepie Flow
A powerful Laravel package for workflow management with states and transitions. Litepie Flow provides a comprehensive solution for building complex business workflows with state management and event-driven transitions, seamlessly integrated with the Litepie Actions package.
Features
- 🔄 Workflow Management: Define complex workflows with states and transitions
- 📊 State Management: Track and manage entity states throughout their lifecycle
- ⚙️ State Machines: Lightweight state management for individual model attributes
- ⚡ Event System: Built-in event handling for workflow transitions
- 🎯 Action Integration: Seamless integration with the Litepie Actions package
- 📝 Database Logging: Track workflow executions and transition history
- 🚀 Laravel Integration: Seamless integration with Laravel's ecosystem
- 🔧 Extensible: Easy to extend and customize for your specific needs
Installation
Install the package via Composer:
Note: This will automatically install the required
litepie/actionsdependency.
Publish and Run Migrations
Publish and run the migrations:
Configuration (Optional)
Optionally, publish the configuration file:
Quick Start
Option 1: Simple State Machine (Recommended for basic state tracking)
For simple state tracking on model attributes, use state machines:
Option 2: Complex Workflows (For business processes)
For complex business processes, use workflows:
1. Create an Action
First, create an action that will be executed during workflow transitions:
2. Define a Workflow
Create a workflow class that defines your business process:
3. Make Your Model Workflowable
Implement the workflow interface in your Eloquent model:
4. Register Your Workflow
Register the workflow in a service provider:
Don't forget to register your service provider in config/app.php:
Usage Examples
Basic Workflow Operations
Advanced Usage
Configuration
After publishing the config file, you can customize various aspects of the workflow system:
Architecture
Core Components
- Workflows: Define complex business processes with multiple participants
- State Machines: Handle simple state transitions for individual model attributes
- States: Represent different stages in workflows and state machines
- Transitions: Define how to move between states
- Actions: Execute business logic during transitions
- Events: Handle workflow and state machine lifecycle events
When to Use What
Use Workflows for:
- Complex business processes (order approval, document review)
- Multi-step workflows with multiple participants
- Advanced transition logic with guards and actions
- Process orchestration
Use State Machines for:
- Simple state tracking (order status, payment status)
- Individual attribute state management
- Multiple independent states on the same model
- Lightweight state transitions
State Management
States can be:
- Initial: Starting point of the workflow
- Final: End point of the workflow
- Intermediate: States between initial and final
Action Integration
Actions are powered by the Litepie Actions package and provide:
- Input validation
- Result handling
- Error management
- Retry mechanisms
Events
The package dispatches several events during workflow execution:
workflow.{name}.guard.{transition}- Before transition validationworkflow.{name}.leave.{state}- When leaving a stateworkflow.{name}.transition.{transition}- During transitionworkflow.{name}.enter.{state}- When entering a stateworkflow.{name}.entered.{state}- After entering a state
Event Listeners
Testing
Run the tests with:
Dependencies
This package depends on:
- litepie/actions - For action pattern implementation
- Laravel 8.x|9.x|10.x|11.x
- PHP 8.0+
Documentation
For more detailed documentation, please refer to:
- 📊 State Machines - Simple state management for model attributes
- 🔄 Workflows - Complex workflow management guide
- 🔄 States & Transitions - State and transition documentation
- ⚡ Actions - Action development guide
- 📡 Events - Event system documentation
- 🔧 Integration - Integration patterns and examples
Contributing
Please see CONTRIBUTING.md for details on how to contribute to this project.
Development Setup
- Clone the repository
- Install dependencies:
composer install - Run tests:
composer test - Check code style:
composer cs-check - Fix code style:
composer cs-fix
Security
If you discover any security-related issues, please email the maintainers instead of using the issue tracker.
Changelog
Please see CHANGELOG.md for more information about what has changed recently.
License
The MIT License (MIT). Please see LICENSE.md for more information.
Credits
- Lavalite Team
- All Contributors
Support
If you find this package useful, please consider:
- ⭐ Starring the repository
- 🐛 Reporting bugs
- 💡 Suggesting new features
- 🔄 Contributing code improvements
🏢 About
This package is part of the Litepie ecosystem, developed by Renfos Technologies.
Organization Structure
- Vendor: Litepie
- Framework: Lavalite
- Company: Renfos Technologies
Links & Resources
- 🌐 Website: https://lavalite.org
- 📚 Documentation: https://docs.lavalite.org
- 💼 Company: https://renfos.com
- 📧 Support: [email protected]
Built with ❤️ by Renfos Technologies
Empowering developers with robust Laravel solutions
All versions of flow with dependencies
illuminate/support Version ^12.0
illuminate/validation Version ^12.0
illuminate/cache Version ^12.0
illuminate/events Version ^12.0
litepie/actions Version ^1.0