PHPackages                             mitch/event-dispatcher - 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. mitch/event-dispatcher

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

mitch/event-dispatcher
======================

Event Dispatcher with a focus on Domain Events

0.1(12y ago)102541MITPHPPHP &gt;=5.4.0

Since Mar 8Pushed 9y ago3 watchersCompare

[ Source](https://github.com/mitchellvanw/event-dispatcher)[ Packagist](https://packagist.org/packages/mitch/event-dispatcher)[ RSS](/packages/mitch-event-dispatcher/feed)WikiDiscussions master Synced 2mo ago

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

Event Dispatcher
================

[](#event-dispatcher)

> This repository has been moved to [Big Name](https://github.com/heybigname/event-dispatcher). There won't be any support here. Visit Big Name's repository for the newest updates.

An Event Dispatcher built with a focus on Domain Events.

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

[](#installation)

Begin by installing the package through Composer. Edit your project's `composer.json` file to require `mitch/event-dispatcher`.

```
"require": {
  "mitch/event-dispatcher": "0.1.x"
}
```

Next use Composer to update your project from the the Terminal:

```
php composer.phar update
```

Once the package has been installed you'll need to add the service provider. Open your `app/config/app.php` configuration file, and add a new item to the `providers` array.

```
'Mitch\EventDispatcher\Laravel\EventDispatcherServiceProvider'
```

How It Works
------------

[](#how-it-works)

### Event

[](#event)

In your domain you'll create an event, for let's say when a new user has been added. Lets call this event `UserCreatedEvent`. This event will hold the necessary information for the listener to fulfill it's job. You have complete freedom about which arguments it takes, since you'll be the one passing them in. In some ways this event is a `Date Transfer Object` (DTO).

For example:

```
