Download the PHP package splitstack/laravel-conveyor without Composer

On this page you can find all versions of the php package splitstack/laravel-conveyor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-conveyor

splitstack/laravel-conveyor

A lightweight saga pattern for Laravel. Brings explicit compensation contracts to Actions, UseCases, and Sequences.


The Problem

When a sequence sequences DB writes alongside external API calls, no single transaction can provide consistency. DB transactions are local; Stripe charges, S3 puts, and webhook calls are not rollbackable. Standard try/catch leaves the compensation logic scattered and implicit.

This package makes it structural.


Core Concepts

DB rollback is owned by the transaction. undo() is for everything else (API calls, S3, webhooks). An Action whose only mutations are DB writes declares an empty undo() which is the explicit answer to the compensation question.


Installation

The service provider is auto-discovered.


Actions


UseCases

A UseCase is a CompensableScope over its Actions and is itself Compensable so a parent pipeline can undo it, cascading compensation down to every Action it ran.


SequencePayload

A typed DTO that travels through the pipeline. Constructor-promoted properties for entry-time data; the inherited set/get/has bag for values produced mid-pipeline.


Steps

A Step adapts any existing class, including code that is closed for modification, into the pipeline. It extracts what the callee needs from the payload, calls it, and declares compensation as its own behavior.

Steps declare requires(): array to skip themselves when payload keys are absent:


Sequences

Extend Sequence and call steps() / skippable() / run(). Call transacts() to wrap the whole sequence in one DB transaction (inner UseCase transactions become savepoints). Without it, each step commits on its own and only external state is compensated on failure.

On failure at any step:

  1. DB: the outer transaction rolls back all writes from all steps, including released savepoints.
  2. External state: undo() cascades in reverse through every completed step.

Delegation (async steps)

Some steps don't need to run in-band: a webhook notification, a downstream sync, anything that can happen after the request commits. Mark them with delegate() and they are dispatched to the queue instead of invoked inline.

This is an unopinionated option, not a policy. What the package does and does not do:

Domain events are the alternative when you want post-commit side effects without the queue. The package holds no opinion on which you reach for.


Graceful abort

Throw SequenceAbortedException from any step to stop cleanly. Completed work commits, events fire, no compensation runs.


Compensation failure

If undo() itself throws, the cascade continues (no step is abandoned) and the failure is reported:

Default behavior when no hook is set: Log::error.


Per-step retry

Actions and UseCases opt into retry by overriding getRetryConfig(). isUnrecoverableError() must then be implemented: it is the explicit declaration that some failures should not be retried.

When retries are exhausted, the onStepFailed hook fires before compensation begins. The FailedStep object carries everything needed to dispatch a Laravel queue job:


Nested transaction behavior

Context DB::transaction() behavior
Action inside a UseCase savepoint (released on UseCase "commit")
UseCase inside a Sequence savepoint (rolled back if pipeline rolls back)
UseCase called standalone outermost transaction, commits immediately

DB::afterCommit defers to the outermost transaction in all cases. Events recorded inside a UseCase nested in a pipeline fire only when the pipeline itself commits.


Diagrams

Compensation hierarchy

Both Sequence and TransactionalBoundary use the ManagesUndoStack trait, so each has its own undo stack. On failure, each layer calls compensate() on what it directly tracked: the pipeline compensates its Steps, each UseCase compensates its own Actions (and nested UseCases cascade further).

When Action C (inside Step 2 / UseCase 2) fails, the unwinding is:

  1. UseCase 2 catches → DB::rollBack() to savepoint → compensate() → Action C.undo() (external side-effects only)
  2. Exception bubbles to Sequence → DB::rollBack() real transaction (wipes all DB writes) → compensate() → Step 1.undo() (Step 2 never completed, so it was never tracked)

Execution sequence

Sequence and TransactionalBoundary both call DB::beginTransaction() via Transactioner. Laravel handles nesting with savepoints: the first call opens a real transaction; nested calls create a savepoint. The pipeline holds the outer transaction; each UseCase inside runs on a savepoint. On failure, the UseCase rolls back to its savepoint and calls compensate() on its actions, then the exception bubbles up and the pipeline rolls back the real transaction and calls compensate() on completed Steps.


Scope of this package

This package provides best-effort, in-process compensation with explicit contracts. It is not durable execution, if the process crashes between an external mutation and its undo(), no compensation runs. For guaranteed compensation across process restarts, consider Temporal.io or a durable sequence engine.

The onStepFailed / onCompensationFailed hooks are the extension points for plugging in queue-backed retry.


All versions of laravel-conveyor with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/bus Version ^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/events Version ^10.0|^11.0|^12.0|^13.0
illuminate/pipeline Version ^10.0|^11.0|^12.0|^13.0
illuminate/queue Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package splitstack/laravel-conveyor contains the following files

Loading the files please wait ...