Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Saga Laravel Package

brzuchal/saga

Laravel package implementing the Saga pattern for coordinating long-running, distributed workflows. Helps model multi-step processes with compensating actions, track saga state, and handle failures/retries so complex business transactions stay consistent across services.

View on GitHub
Deep Wiki
Context7

Saga Management

Install

composer require brzuchal/saga

Usage

namespace App;

use App\Events\OrderCreated;
use Brzuchal\Saga\Mapping\Saga;
use Brzuchal\Saga\Mapping\SagaMessageHandler;
use Brzuchal\Saga\Mapping\SagaStart;

#[Saga]
class OrderProcessing
{
    #[SagaStart,SagaMessageHandler(associationKey: 'orderId', property: 'id')]
    public function whenCreated(OrderCreated $event): void
    {
        // ...
    }
}

Configuration

use App\OrderProcessing;
use App\Events\OrderCreated;
use Brzuchal\Saga\Mapping\AttributeMappingDriver;
use Brzuchal\Saga\Mapping\SagaMetadataFactory;
use Brzuchal\Saga\Repository\SimpleSagaRepositoryFactory;
use Brzuchal\Saga\SagaManager;
use Brzuchal\Saga\Store\InMemorySagaStore;

$repositoryFactory = new SimpleSagaRepositoryFactory(
    new InMemorySagaStore(), 
    new SagaMetadataFactory([new AttributeMappingDriver()]),
);

$manager = new SagaManager($repositoryFactory->create(OrderProcessing::class));
$manager(new OrderCreated());
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor