PHPackages                             mistery23/laravel-aggregate-events - 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. [Database &amp; ORM](/categories/database)
4. /
5. mistery23/laravel-aggregate-events

AbandonedArchivedPackage[Database &amp; ORM](/categories/database)

mistery23/laravel-aggregate-events
==================================

laravel aggregate events

v1.0.1(6y ago)0111MITPHPPHP ^7.2

Since Jan 6Pushed 6y ago1 watchersCompare

[ Source](https://github.com/mistery23/laravel-aggregate-events)[ Packagist](https://packagist.org/packages/mistery23/laravel-aggregate-events)[ Docs](https://github.com/mistery23/laravel-aggregate-events.git)[ RSS](/packages/mistery23-laravel-aggregate-events/feed)WikiDiscussions master Synced 1mo ago

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

Laravel value objects
=====================

[](#laravel-value-objects)

Install
-------

[](#install)

```
composer require mistery23/laravel-aggregate-events

```

Features
--------

[](#features)

Add domain events to your entity. Record your event and release.
----------------------------------------------------------------

[](#add-domain-events-to-your-entity-record-your-event-and-release)

Using
-----

[](#using)

```
use Mistery23\AggregateEvents\EventTrait;

class User extends Model implements AggregateEventRoot
{
    use EventTrait;

    public static function signUp(
        Id   $id,
        Name $name,
            ...
    ): self {
        $user = new self();

        $user->id            = $id;
        $user->name          = $name;
           ...

        $user->recordEvent(new UserSignupedEvent($user));

        return $user;
    }
 }
```

---

And release events:
-------------------

[](#and-release-events)

```
use Mistery23\AggregateEvents\EventDispatcher;

class UserRepository
{

    private $dispatcher;

    /**
     * UserRepository constructor.
     *
     * @param EventDispatcher $dispatcher
     */
    public function __construct(EventDispatcher $dispatcher)
    {
        $this->dispatcher = $dispatcher;
    }

    /**
     * Add user
     *
     * @param Model $user
     *
     * @return void
     *
     * @throws \RuntimeException
     */
    public function add(Model $user): void
    {
        if (false === $user->save()) {
            throw new \RuntimeException('Save error.');
        }

        $this->dispatcher->dispatchAll($user->releaseEvents());
    }
}
```

---

License
-------

[](#license)

This package is free software distributed under the terms of the [MIT license](https://opensource.org/licenses/MIT). Enjoy!

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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 ~0 days

Total

2

Last Release

2318d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/86dc8a5e2e48c6a2223042e929b4d306ce437495a3c4aaf0e2e945355eda7789?d=identicon)[mistery23](/maintainers/mistery23)

---

Top Contributors

[![alexandrbarabolia](https://avatars.githubusercontent.com/u/17147023?v=4)](https://github.com/alexandrbarabolia "alexandrbarabolia (2 commits)")

---

Tags

laraveleventsmodeleloquentdddaggregatesdomain-event

### Embed Badge

![Health badge](/badges/mistery23-laravel-aggregate-events/health.svg)

```
[![Health](https://phpackages.com/badges/mistery23-laravel-aggregate-events/health.svg)](https://phpackages.com/packages/mistery23-laravel-aggregate-events)
```

###  Alternatives

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[jpkleemans/attribute-events

🔥 Fire events on attribute changes of your Eloquent model

332484.7k1](/packages/jpkleemans-attribute-events)[lacodix/laravel-model-filter

A Laravel package to filter, search and sort models with ease while fetching from database.

17649.9k](/packages/lacodix-laravel-model-filter)

PHPackages © 2026

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