PHPackages                             jacob-hyde/requestorchestrator - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. jacob-hyde/requestorchestrator

ActiveLibrary[HTTP &amp; Networking](/categories/http)

jacob-hyde/requestorchestrator
==============================

01.9kPHP

Since Jan 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jacob-hyde/RequestOrchestrator)[ Packagist](https://packagist.org/packages/jacob-hyde/requestorchestrator)[ RSS](/packages/jacob-hyde-requestorchestrator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Request Orchestrator
====================

[](#request-orchestrator)

The **Request Orchestrator** is a Laravel package designed to simplify handling complex form submissions that require executing multiple sequential actions. It allows you to define actions, handle validation, and optionally manage database transactions, ensuring a clean and structured approach to multi-step processes.

---

Features
--------

[](#features)

- **Sequential Action Execution**: Define a list of actions to be executed in order.
- **Conditional Execution**: Skip actions based on dynamic conditions.
- **Integrated Validation**: Leverages Laravel's validation system.
- **Optional Transactions**: Enable or disable database transactions per request.
- **Error Handling and Rollbacks**: Rollback executed actions if an error occurs.

---

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

[](#installation)

Install the package via Composer:

```
composer require jacob-hyde/request-orchestrator
```

---

Usage
-----

[](#usage)

### 1. Create a Custom Request Class

[](#1-create-a-custom-request-class)

Extend the `SequencedRequest` class to define the actions and validation rules for your request.

```
namespace App\Http\Requests;

use JacobHyde\RequestOrchestrator\Requests\SequencedRequest;

class MyCustomRequest extends SequencedRequest
{
    protected array $actions = [
        \App\Actions\ActionOne::class,
        \App\Actions\ActionTwo::class,
    ];

    public function rules(): array
    {
        return [
            'field1' => 'required|string',
            'field2' => 'required|integer',
        ];
    }
}
```

### 2. Define Actions

[](#2-define-actions)

Actions should extend the `FormAction` class and implement the `handle` and `rollback` methods.

```
namespace App\Actions;

use JacobHyde\RequestOrchestrator\Actions\FormAction;

class ActionOne extends FormAction
{
    protected array $requiredFields = ['field1'];

    public function handle(array $data, $previousOutput = null)
    {
        // Process action logic
        return 'ActionOneOutput';
    }

    public function rollback($previousOutput)
    {
        // Handle rollback logic
    }
}
```

### 3. Use the Request in a Controller

[](#3-use-the-request-in-a-controller)

```
namespace App\Http\Controllers;

use App\Http\Requests\MyCustomRequest;

class MyController extends Controller
{
    public function store(MyCustomRequest $request)
    {
        $result = $request->handle();
        return response()->json(['result' => $result]);
    }
}
```

---

Configuration
-------------

[](#configuration)

### Optional Transactions

[](#optional-transactions)

By default, `SequencedRequest` uses transactions. To disable transactions for a specific request, override the `$useTransactions` property:

```
protected bool $useTransactions = false;
```

---

Testing
-------

[](#testing)

### Run Tests

[](#run-tests)

Run the package's test suite using PHPUnit:

```
vendor/bin/phpunit
```

### Example Test Case

[](#example-test-case)

```
/** @test */
public function it_executes_actions_in_sequence()
{
    $request = new MyCustomRequest([
        'field1' => 'value1',
        'field2' => 123,
    ]);

    $result = $request->handle();

    $this->assertEquals('ExpectedOutput', $result);
}
```

---

Contributing
------------

[](#contributing)

Contributions are welcome! Feel free to submit a pull request or open an issue on GitHub.

---

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/272afff1264c6afef6d9bdf167122b57418f476a73ee2959bda30c79114cb86d?d=identicon)[jacobhyde](/maintainers/jacobhyde)

### Embed Badge

![Health badge](/badges/jacob-hyde-requestorchestrator/health.svg)

```
[![Health](https://phpackages.com/badges/jacob-hyde-requestorchestrator/health.svg)](https://phpackages.com/packages/jacob-hyde-requestorchestrator)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
