PHPackages                             bruno-barros/w.eloquent-bus - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bruno-barros/w.eloquent-bus

ActiveProject[Utility &amp; Helpers](/categories/utility)

bruno-barros/w.eloquent-bus
===========================

w.eloquent Command Bus Pattern.

013PHP

Since Jan 14Pushed 11y ago1 watchersCompare

[ Source](https://github.com/bruno-barros/w.eloquent-bus)[ Packagist](https://packagist.org/packages/bruno-barros/w.eloquent-bus)[ RSS](/packages/bruno-barros-weloquent-bus/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

w.eloquent-bus
==============

[](#weloquent-bus)

Command Bus for [w.eloquent project](https://github.com/bruno-barros/w.eloquent).

[![Build Status](https://camo.githubusercontent.com/dd882fbb8bdffc510c204d9ba2ee89e78ce49016df4742949a47246dc72f2fe4/68747470733a2f2f7472617669732d63692e6f72672f6272756e6f2d626172726f732f772e656c6f7175656e742d6275732e737667)](https://travis-ci.org/bruno-barros/w.eloquent-bus)

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

[](#installation)

Update your composer: `"bruno-barros/w.eloquent-bus": "dev-master"`

Set the service provider: `'Weloquent\Bus\BusServiceProvider'`

Run: `composer update`

How to use it
-------------

[](#how-to-use-it)

Create your command and handler.

```
// The command. Just a DTO.
class DoSomethingCommand {

	public $property = 'default value';

}

// On same folder, the handler.
class DoSomethingCommandHandler implements Weloquent\Bus\Contracts\CommandHandler {

	public function handler($command){

		// do whatever you need

	}

}

```

Use the trait and call the `execute` method.

```
class MyClass {

	use Weloquent\Bus\CommanderTrait;

	public function myMethod()
	{
		$input = ['property' => 'some value'];

		$this->execute(new Your\Namespace\DoSomething, $input);

	}
}

```

Or leave the commander handle the input if it exists on GET or POST array;

```
class MyClass {

	use Weloquent\Bus\CommanderTrait;

	// From a POST
	public function myMethod()
	{
		$this->execute(new Your\Namespace\DoSomething);

	}
}

```

Decorators
----------

[](#decorators)

You can decorate the command object (DTO).

Look:

- The decorator must implements `Weloquent\Bus\Contracts\CommandHandler`.
- The decorator should return the command object. Can be the original, or modified one.

```
// Decorator
class DecoratorCommandHandler implements Weloquent\Bus\Contracts\CommandHandler {

        public function handler($command)
        {
            // apply any modification...

            return $command;
        }
    }

// Decorating
class MyClass {

	use Weloquent\Bus\CommanderTrait;

	// From a POST
	public function myMethod()
	{
		$decorator = ['Your\Namespace\DecoratorCommandHandler'];

		$this->execute(new Your\Namespace\DoSomething, null, $decorator);

	}
}

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

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://www.gravatar.com/avatar/c6a425d652b0042b4f27743e6dd142ef3d3e61c66df71daafef771d9eb279420?d=identicon)[bruno-barros](/maintainers/bruno-barros)

---

Top Contributors

[![bruno-barros](https://avatars.githubusercontent.com/u/1840784?v=4)](https://github.com/bruno-barros "bruno-barros (11 commits)")

### Embed Badge

![Health badge](/badges/bruno-barros-weloquent-bus/health.svg)

```
[![Health](https://phpackages.com/badges/bruno-barros-weloquent-bus/health.svg)](https://phpackages.com/packages/bruno-barros-weloquent-bus)
```

PHPackages © 2026

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