Download the PHP package dayemsiddiqui/laravel-saga without Composer
On this page you can find all versions of the php package dayemsiddiqui/laravel-saga. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dayemsiddiqui/laravel-saga
More information about dayemsiddiqui/laravel-saga
Files in dayemsiddiqui/laravel-saga
Package laravel-saga
Short Description This is my package laravel-saga
License MIT
Homepage https://github.com/dayemsiddiqui/laravel-saga
Informations about the package laravel-saga
This is my package laravel-saga
The Laravel Saga package helps you manage complex workflows by breaking them down into a series of sequential steps. It orchestrates these steps as a 'saga', executing them in order and tracking the progress of each one in your database. This gives you a clear and persistent overview of your long-running processes, like an e-commerce order flow or a video processing pipeline.
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
Installation
You can install the package via composer:
And then you can run:
You can publish the config file with:
This is the contents of the published config file:
Optionally, you can publish the views using
Usage
1. Create Your Saga Steps
Each step in your saga should extend the SagaStep
abstract class and implement the run()
method:
2. Run a Saga
You can chain your steps and dispatch the saga like this:
- Each step will be executed in order.
- The saga and each step’s status will be tracked in the database.
- Use the
context()
helper to share data between steps.
Testing your Sagas
This package provides a fake implementation of the Saga
facade that you can use in your tests to avoid actually dispatching the jobs.
To use it, call Saga::fake()
at the beginning of your test.
assertDispatched(string $name, ?array $steps = null)
Asserts that a saga with the given name was dispatched. You can also optionally assert that it was dispatched with a specific chain of steps.
assertNotDispatched(string $name)
Asserts that a saga with the given name was not dispatched.
assertDispatchedCount(int $count)
Asserts that a specific number of sagas were dispatched.
Running Tests
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
- Dayem Siddiqui
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-saga with dependencies
illuminate/contracts Version ^10.0|^11.0|^12.0
illuminate/queue Version ^10.0|^11.0|^12.0
spatie/laravel-package-tools Version ^1.16