PHPackages                             cakephp/event - 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. [Framework](/categories/framework)
4. /
5. cakephp/event

ActiveLibrary[Framework](/categories/framework)

cakephp/event
=============

CakePHP event dispatcher library that helps implementing the observer pattern

5.3.6(3mo ago)23341.0k↓64.6%310MITPHPPHP &gt;=8.2

Since Nov 8Pushed 5d ago26 watchersCompare

[ Source](https://github.com/cakephp/event)[ Packagist](https://packagist.org/packages/cakephp/event)[ Docs](https://cakephp.org)[ RSS](/packages/cakephp-event/feed)WikiDiscussions 5.x Synced yesterday

READMEChangelogDependencies (4)Versions (347)Used By (10)

[![Total Downloads](https://camo.githubusercontent.com/ad031a788467d4952ba865e83ce78a3250c20cb1a8d7810c6a783ed7195ae9db/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616b657068702f6576656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cakephp/event)[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)

CakePHP Event Library
=====================

[](#cakephp-event-library)

This library emulates several aspects of how events are triggered and managed in popular JavaScript libraries such as jQuery: An event object is dispatched to all listeners. The event object holds information about the event, and provides the ability to stop event propagation at any point. Listeners can register themselves or can delegate this task to other objects and have the chance to alter the state and the event itself for the rest of the callbacks.

Usage
-----

[](#usage)

Listeners need to be registered into a manager and events can then be triggered so that listeners can be informed of the action.

```
use Cake\Event\Event;
use Cake\Event\EventDispatcherTrait;

class Orders
{

	use EventDispatcherTrait;

	public function placeOrder($order)
	{
		$this->doStuff();
		$event = new Event('Orders.afterPlace', $this, [
			'order' => $order
		]);
		$this->getEventManager()->dispatch($event);
	}
}

$orders = new Orders();
$orders->getEventManager()->on(function ($event) {
	// Do something after the order was placed
	...
}, 'Orders.afterPlace');

$orders->placeOrder($order);
```

The above code allows you to easily notify the other parts of the application that an order has been created. You can then do tasks like send email notifications, update stock, log relevant statistics and other tasks in separate objects that focus on those concerns.

Documentation
-------------

[](#documentation)

Please make sure you check the [official documentation](https://book.cakephp.org/5/en/core-libraries/events.html)

###  Health Score

70

—

ExcellentBetter than 100% of packages

Maintenance90

Actively maintained with recent releases

Popularity45

Moderate usage in the ecosystem

Community38

Small or concentrated contributor base

Maturity95

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~23 days

Total

340

Last Release

25d ago

Major Versions

3.10.0 → 4.2.0-RC12020-11-01

3.10.4 → 4.4.02022-05-29

4.4.8 → 5.0.0-beta12022-11-30

4.x-dev → 5.0.02023-04-18

5.4.0-RC2 → 6.x-dev2026-06-08

PHP version history (7 changes)3.4.8PHP &gt;=5.6.0

4.0.0-beta1PHP &gt;=7.2.0

3.9.5PHP &gt;=5.6.0,&lt;8.0.0

4.4.0-RC2PHP &gt;=7.4.0

5.0.0-beta1PHP &gt;=8.1

5.3.0-RC1PHP &gt;=8.2

6.x-devPHP &gt;=8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23666?v=4)[CakePHP](/maintainers/cakephp)[@cakephp](https://github.com/cakephp)

---

Top Contributors

[![ADmad](https://avatars.githubusercontent.com/u/142658?v=4)](https://github.com/ADmad "ADmad (117 commits)")[![markstory](https://avatars.githubusercontent.com/u/24086?v=4)](https://github.com/markstory "markstory (106 commits)")[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (50 commits)")[![othercorey](https://avatars.githubusercontent.com/u/24221186?v=4)](https://github.com/othercorey "othercorey (43 commits)")[![lorenzo](https://avatars.githubusercontent.com/u/37621?v=4)](https://github.com/lorenzo "lorenzo (15 commits)")[![robertpustulka](https://avatars.githubusercontent.com/u/7437773?v=4)](https://github.com/robertpustulka "robertpustulka (11 commits)")[![ravage84](https://avatars.githubusercontent.com/u/625761?v=4)](https://github.com/ravage84 "ravage84 (11 commits)")[![LordSimal](https://avatars.githubusercontent.com/u/9105243?v=4)](https://github.com/LordSimal "LordSimal (9 commits)")[![bcrowe](https://avatars.githubusercontent.com/u/752603?v=4)](https://github.com/bcrowe "bcrowe (6 commits)")[![jeremyharris](https://avatars.githubusercontent.com/u/184903?v=4)](https://github.com/jeremyharris "jeremyharris (5 commits)")[![antograssiot](https://avatars.githubusercontent.com/u/4977112?v=4)](https://github.com/antograssiot "antograssiot (5 commits)")[![Harfusha](https://avatars.githubusercontent.com/u/47174548?v=4)](https://github.com/Harfusha "Harfusha (5 commits)")[![jeffblack360](https://avatars.githubusercontent.com/u/532851?v=4)](https://github.com/jeffblack360 "jeffblack360 (3 commits)")[![kalessil](https://avatars.githubusercontent.com/u/1577185?v=4)](https://github.com/kalessil "kalessil (2 commits)")[![chinpei215](https://avatars.githubusercontent.com/u/7399393?v=4)](https://github.com/chinpei215 "chinpei215 (2 commits)")[![saeideng](https://avatars.githubusercontent.com/u/8215801?v=4)](https://github.com/saeideng "saeideng (2 commits)")[![Theaxiom](https://avatars.githubusercontent.com/u/57013?v=4)](https://github.com/Theaxiom "Theaxiom (2 commits)")[![Iandenh](https://avatars.githubusercontent.com/u/2911923?v=4)](https://github.com/Iandenh "Iandenh (1 commits)")[![freefri](https://avatars.githubusercontent.com/u/2754631?v=4)](https://github.com/freefri "freefri (1 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (1 commits)")

---

Tags

eventcakephpdispatcherobserver pattern

### Embed Badge

![Health badge](/badges/cakephp-event/health.svg)

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

###  Alternatives

[cakephp/utility

CakePHP Utility classes such as Inflector, String, Hash, and Security

12129.0M84](/packages/cakephp-utility)[cakephp/database

Flexible and powerful Database abstraction library with a familiar PDO-like API

9826.4M46](/packages/cakephp-database)[composer/installers

A multi-framework Composer library installer

1.4k143.6M6.8k](/packages/composer-installers)[cakephp/datasource

Provides connection managing and traits for Entities and Queries that can be reused for different datastores

4726.4M15](/packages/cakephp-datasource)[cakephp/cache

Easy to use Caching library with support for multiple caching backends

518.7M24](/packages/cakephp-cache)[cakephp/orm

CakePHP ORM - Provides a flexible and powerful ORM implementing a data-mapper pattern.

151252.5k83](/packages/cakephp-orm)

PHPackages © 2026

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