PHPackages                             brunoggdev/ci4-events-extended - 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. brunoggdev/ci4-events-extended

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

brunoggdev/ci4-events-extended
==============================

Lightweight and easy to use helpers and tooling to enhance CodeIgniter4 event system on user code to a more OOP approach.

v0.2.0(1mo ago)0263↓50%MITPHP

Since Dec 1Pushed 1mo agoCompare

[ Source](https://github.com/brunoggdev/ci4-events-extended)[ Packagist](https://packagist.org/packages/brunoggdev/ci4-events-extended)[ RSS](/packages/brunoggdev-ci4-events-extended/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Events Extended for CodeIgniter 4
=================================

[](#events-extended-for-codeigniter-4)

Lightweight, developer-friendly helpers and tooling that enhance the way you work with the CodeIgniter 4 Events system using a more OOP approach. This package provides a cleaner, more expressive way to register and trigger events using simple event classes and invokable or `handle()`-based listeners.

---

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require brunoggdev/ci4-events-extended
```

The package auto-loads itself — no configuration or publishing required.

---

🚀 Features
----------

[](#-features)

- **Event classes instead of string names**
- **Automatic listener resolution**
    - Invokable listeners (`__invoke`)
    - Or listeners with a `handle()` method
- **Simple `listen()` helper** to register multiple listeners at once
- **Simple `event()` helper** to dispatch event objects
- **Configurable error handling** for listener failures
- **Optional make commands**
    - `make:event`
    - `make:listener`
- **Publish command** to customize default configuration
    - `events:publish`

---

🧩 Usage
-------

[](#-usage)

### 1. Create an Event Class

[](#1-create-an-event-class)

```
