PHPackages                             jozi/laravel-rabbitevents-sourcing - 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. jozi/laravel-rabbitevents-sourcing

ActiveLibrary

jozi/laravel-rabbitevents-sourcing
==================================

Integration between nuwber/rabbitevents and spatie/laravel-event-sourcing packages

1.0.2(4y ago)054MITPHPPHP ^8.0

Since Jul 12Pushed 4y ago1 watchersCompare

[ Source](https://github.com/jg-rivera/laravel-rabbitevents-sourcing)[ Packagist](https://packagist.org/packages/jozi/laravel-rabbitevents-sourcing)[ RSS](/packages/jozi-laravel-rabbitevents-sourcing/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

RabbitEvents Sourcing
=====================

[](#rabbitevents-sourcing)

A simple integration between `nuwber/rabbitevents` and `spatie/laravel-event-sourcing`. Both are used to facilitate event sourcing and intraservice communication using RabbitMQ topic exchanges.

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

[](#installation)

Using composer:

```
composer require jozi/laravel-rabbitevents-sourcing
```

Usage/Examples
--------------

[](#usageexamples)

All stored and published events extends the `StoredRabbitEvent` class. These events will be handled for both event sourcing (`spatie/laravel-event-sourcing`) and publishing to RabbitMQ (`nuwber/rabbitevents`).

For this class, a string `$eventKey` is explictly required for the event to be published. The `$eventKey` is the same as RabbitMQ's routing key.

```
use Jozi\Events\StoredRabbitEvent;

class AccountCreated extends StoredRabbitEvent
{
    public $eventKey = 'account.created';

    /** @var array */
    public $accountAttributes;

    public function __construct(array $accountAttributes)
    {
        $this->accountAttributes = $accountAttributes;
    }

    public function toPublish(): array
    {
        return $this->accountAttributes;
    }
}
```

After an event has been defined, you may invoke it using the `publish_event` helper function. It is just a simple wrapper for invoking both `event` and `publish` as a one-liner.

```
class Account extends Model
{
    protected $guarded = [];

    public static function createWithAttributes(array $attributes): Account
    {
        /*
         * Let's generate a uuid.
         */
        $attributes['uuid'] = (string) Uuid::uuid4();

        /*
         * The account will be created inside this event using the generated uuid.
         */
        publish_event(new AccountCreated($attributes));

        /*
         * The uuid will be used the retrieve the created account.
         */
        return static::getByUuid($attributes['uuid']);
    }
}
```

Acknowledgements
----------------

[](#acknowledgements)

- [nuwber/rabbitevents](https://github.com/nuwber/rabbitevents)
- [spatie/laravel-event-sourcing](https://github.com/spatie/laravel-event-sourcing/)

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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.

###  Release Activity

Cadence

Every ~10 days

Total

3

Last Release

1745d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/874ec83fbdaa156007056608e28b79f3cf6dbae1023c40d9da29f81cc6130ae0?d=identicon)[jg-rivera](/maintainers/jg-rivera)

---

Top Contributors

[![jgarivera](https://avatars.githubusercontent.com/u/27613092?v=4)](https://github.com/jgarivera "jgarivera (12 commits)")

### Embed Badge

![Health badge](/badges/jozi-laravel-rabbitevents-sourcing/health.svg)

```
[![Health](https://phpackages.com/badges/jozi-laravel-rabbitevents-sourcing/health.svg)](https://phpackages.com/packages/jozi-laravel-rabbitevents-sourcing)
```

###  Alternatives

[darkaonline/swagger-lume

OpenApi or Swagger integration to Lumen

3372.3M3](/packages/darkaonline-swagger-lume)[pearl/lumen-request-validate

Lumen doesn't have form request validator seperatly. This package helps developers to segregate the validation layer from the controller to a separate dedicated class

45390.3k2](/packages/pearl-lumen-request-validate)[niellles/lumen-commands

Adds artisan commands to Lumen that aren't available by default.

1860.1k](/packages/niellles-lumen-commands)[rogervila/lumen-rate-limiting

 Lumen port of Laravel ThrottleRequests middleware

1662.5k1](/packages/rogervila-lumen-rate-limiting)[vluzrmos/collective-html

LaravelCollective Html and Form builder for Lumen.

2523.9k](/packages/vluzrmos-collective-html)[albertoarena/laravel-event-sourcing-generator

Laravel event sourcing domain generator

148.2k](/packages/albertoarena-laravel-event-sourcing-generator)

PHPackages © 2026

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