Download the PHP package jeromejhipolito/laravel-saga without Composer
On this page you can find all versions of the php package jeromejhipolito/laravel-saga. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download jeromejhipolito/laravel-saga
More information about jeromejhipolito/laravel-saga
Files in jeromejhipolito/laravel-saga
Download jeromejhipolito/laravel-saga
More information about jeromejhipolito/laravel-saga
Files in jeromejhipolito/laravel-saga
Vendor jeromejhipolito
Package laravel-saga
Short Description Laravel package for Saga transaction pattern - manage distributed transactions with automatic rollback support
License MIT
Package laravel-saga
Short Description Laravel package for Saga transaction pattern - manage distributed transactions with automatic rollback support
License MIT
Please rate this library. Is it a good library?
Informations about the package laravel-saga
Laravel Saga
Laravel package for implementing the Saga transaction pattern - manage distributed transactions with automatic rollback support.
Features
- Step-by-step execution - Execute multiple steps in sequence with automatic tracking
- Automatic rollback - When a step fails, previously executed steps are automatically rolled back in reverse order
- Database persistence - Transaction and step states are persisted for debugging and recovery
- Status tracking - Detailed status enums for both transactions and steps
- Easy integration - Simple trait for Jobs and Consumers
Installation
Publish and run the migrations:
Usage
Creating a Saga Step
Create a step by extending AbstractSagaStep:
Using the UsesSaga Trait in Jobs
Direct Usage with SagaTransactionManager
Checking Transaction Status
Transaction and Step Statuses
Transaction Statuses:
PENDING- Transaction created, not yet startedRUNNING- Transaction is executing stepsCOMPLETED- All steps executed successfullyFAILED- A step failed during executionROLLING_BACK- Rollback is in progressROLLED_BACK- Rollback completed
Step Statuses:
PENDING- Step not yet executedEXECUTED- Step completed successfullyFAILED- Step execution failedROLLED_BACK- Step was rolled backCANCELLED- Step was never executed (skipped due to earlier failure)
Database Schema
The package creates two tables:
saga_transactions
id- Primary keyuuid- Unique identifiertransaction_id- Your custom transaction IDjob_class- The class that initiated the sagapayload- JSON payload datastatus- Current transaction statusstarted_at,completed_at,failed_at- Timestampsrollback_started_at,rollback_completed_at- Rollback timestampserror_message- Error details if failed
saga_steps
id- Primary keyuuid- Unique identifiersaga_transaction_id- Foreign key to transactionstep_name- Name of the stepstep_class- Full class name of the stepstep_order- Execution orderstatus- Current step statusexecuted_at,rollback_at- Timestampsresult_data- JSON result from executionerror_message- Error details if failed
Testing
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-saga with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.2
illuminate/support Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
The package jeromejhipolito/laravel-saga contains the following files
Loading the files please wait ...