PHPackages                             eng-mmustafa/laravel-saga-workflow - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. eng-mmustafa/laravel-saga-workflow

ActiveLibrary[Queues &amp; Workers](/categories/queues)

eng-mmustafa/laravel-saga-workflow
==================================

A powerful Laravel package implementing the Saga Pattern for managing long-running distributed transactions with automatic compensation logic. Build robust, fault-tolerant applications with step-by-step transaction management and automatic rollback capabilities.

303PHP

Since Oct 26Pushed 6mo agoCompare

[ Source](https://github.com/Eng-MMustafa/laravel-saga-workflow)[ Packagist](https://packagist.org/packages/eng-mmustafa/laravel-saga-workflow)[ RSS](/packages/eng-mmustafa-laravel-saga-workflow/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Saga Workflow Manager
=============================

[](#laravel-saga-workflow-manager)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e3bd8e89c6bf816a646f9bbd529179cf2e95f4543c432505be675eefc8e2d7dd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656e672d6d6d7573746166612f6c61726176656c2d736167612d776f726b666c6f772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/eng-mmustafa/laravel-saga-workflow)[![Total Downloads](https://camo.githubusercontent.com/949d6bbbd0e1685b7bb48df108491d415f1b6f5573d90463f4f5956bfdb6149b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656e672d6d6d7573746166612f6c61726176656c2d736167612d776f726b666c6f772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/eng-mmustafa/laravel-saga-workflow)[![License](https://camo.githubusercontent.com/8e7463cd2c4342d7dffc9e6cbe991bb7201dbdcb0e9a614138d0b90f9c88cca8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f656e672d6d6d7573746166612f6c61726176656c2d736167612d776f726b666c6f772e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/eng-mmustafa/laravel-saga-workflow)

A powerful Laravel package that implements the Saga Pattern for managing long-running processes and distributed transactions with automatic compensation logic.

Features
--------

[](#features)

- 🚀 **Easy to Use**: Simple, intuitive API for defining and executing sagas
- 🔄 **Automatic Compensation**: Built-in rollback mechanism when steps fail
- 📊 **Step-by-Step Execution**: Sequential execution with progress tracking
- 🎯 **Event-Driven**: Rich event system for monitoring saga lifecycle
- 💾 **Persistent State**: Database storage for saga state and context
- ⚡ **Retry Logic**: Configurable retry attempts for failed sagas
- 📝 **Comprehensive Logging**: Detailed logging for debugging and monitoring
- 🧪 **Fully Tested**: Comprehensive test suite included

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require eng-mmustafa/laravel-saga-workflow
```

### Publish and run migrations

[](#publish-and-run-migrations)

```
php artisan vendor:publish --tag="saga-migrations"
php artisan migrate
```

### Publish configuration file (optional)

[](#publish-configuration-file-optional)

```
php artisan vendor:publish --tag="saga-config"
```

Quick Start
-----------

[](#quick-start)

### 1. Create a Step

[](#1-create-a-step)

First, create a step by extending the `AbstractStep` class:

```
