PHPackages                             jesseobrien/commandbus - 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. jesseobrien/commandbus

ActiveLibrary

jesseobrien/commandbus
======================

A CommandBus base.

491PHP

Since Sep 21Pushed 11y ago1 watchersCompare

[ Source](https://github.com/JesseObrien/CommandBus)[ Packagist](https://packagist.org/packages/jesseobrien/commandbus)[ RSS](/packages/jesseobrien-commandbus/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

CommandBus Base
---------------

[](#commandbus-base)

This package provides an opinionated base to get started using the Command Bus architecture in PHP. Most of what's here has been derived from code and discussions with @ShawnMcCool. The structure may not fit with everyone's definitions of how a Command Bus should be implemented, however it provides a path of little resistance for newcomers.

### Um.. wat

[](#um-wat)

If you're unfamiliar with Command Bus style architecture I urge you to check out a talk that @ShawnMcCool gave at [Laracon 2014](http://www.youtube.com/watch?v=2_380DKU93U). Another great resource on learning the concepts and reasons for this style of architecture is a series at [Laracasts](http://laracasts.com) called [Commands and Domain Events](https://laracasts.com/series/commands-and-domain-events). For more advance reading and learning, check out [Mathias Verraes' website](http://verraes.net/#talks).

### Buses

[](#buses)

This package comes by default with:

- ExecutionBus
- ValidationBus
- LoggingBus

How you stack them is up to you, however the ExecutionBus must come last to deliver the request to the final `handle()` call.

If you would like an example of how the buses are instantiated, check the service provider's `register()` included in the source here.

### Laravel Service Provider

[](#laravel-service-provider)

If you wish to integrate the commandbus with Laravel, there is one provided. You can simply add it to your providers array in `app/config/app.php` and start injecting the `CommandBus\CommandBus` interface into your controllers and classes.

`'CommandBus\CommandBusServiceProvider',`

**Note**: The execution order of the busses is:`Request -> LoggingBus -> ValidationBus -> ExecutionBus -> Handler`. If you wish to re-arrange the bus execution order, by all means make your own service provider and reorganize them. You could even write your own bus if you wanted.

### Example Request Cycle

[](#example-request-cycle)

To set up an example request cycle, we simply need a request object and handler and response objects to match.

Examples can be found in the [examples](https://github.com/JesseObrien/CommandBus/tree/master/examples) directory.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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://avatars.githubusercontent.com/u/865481?v=4)[Jesse O'Brien](/maintainers/JesseObrien)[@jesseobrien](https://github.com/jesseobrien)

---

Top Contributors

[![jesseobrien](https://avatars.githubusercontent.com/u/865481?v=4)](https://github.com/jesseobrien "jesseobrien (7 commits)")

### Embed Badge

![Health badge](/badges/jesseobrien-commandbus/health.svg)

```
[![Health](https://phpackages.com/badges/jesseobrien-commandbus/health.svg)](https://phpackages.com/packages/jesseobrien-commandbus)
```

PHPackages © 2026

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