PHPackages                             cleup/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. cleup/events

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

cleup/events
============

A convenient event system for modifying and extending the web application platform

v1.0.1(1y ago)018MITPHPPHP &gt;=8.1

Since Jun 17Pushed 1y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Cleup - Web application events
==============================

[](#cleup---web-application-events)

#### Installation

[](#installation)

Install the `cleup/events` library using composer:

```
composer require cleup/events

```

#### Usage

[](#usage)

##### Event initialization

[](#event-initialization)

```
use Cleup\Components\Events\Event;

# Simple event
Event::apply('customEvent');

# Event with arguments
$name = 'Eduard';
$age = 30;
$fields = array(
    'login' => 'priveted',
    'type' => 'admin'
);
Event::apply('customEvent', $name, $age, $fields, ...);
```

##### Add a new event

[](#add-a-new-event)

```
use Cleup\Components\Events\Event;

# With the function
Event::add('customEvent', function () {
   print_r("Hi, I've been added to the event thread");
});

# Using the function name
function helloWorld () {
    print_r('Hello World!');
}

Event::add('customEvent', 'helloWorld');

# Using the class method
Event::add('customEvent', [Example::class, 'get']);
```

##### Modifiers for adding an event

[](#modifiers-for-adding-an-event)

Assign the position of the callback execution.

```
use Cleup\Components\Events\Event;

Event::add('getPosts', function (&$postList) {
    // ...
})->position(100);
```

Create an ID for the event. You can use this ID to delete a specific event

```
use Cleup\Components\Events\Event;

Event::add('getPosts', function (&$postList) {
    // ...
})->id('isBadPost');
```

Execute once. The modifier can be useful if the event is executed multiple times or in a loop.

```
use Cleup\Components\Events\Event;

Event::add('postItem', function ($post) {
    // This event will be deleted immediately after execution
})->once();

$posts = array(
    0 => [
        'id' => 1
        'title' => 'First post'
    ],
    1 => [
        'id' => 2
        'title' => 'Hello world!'
    ]
)

foreach($posts as $post) {
    // The event will be executed only once and will be deleted
    Event::apply('postItem', $post);
}
```

##### Delete event

[](#delete-event)

```
Event::delete('getdPosts');

// Delete event by ID
Event::delete('getdPosts', 'isBadPost');
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

699d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf4be3cc2bdc4eef1f841172c8a46ac77d3a4708765dd3c2a4ebe60c2b17931f?d=identicon)[cleup](/maintainers/cleup)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/cleup-events/health.svg)

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

###  Alternatives

[rlanvin/php-ip

IPv4/IPv6 manipulation library for PHP

180738.8k11](/packages/rlanvin-php-ip)[pagerfanta/core

Core Pagerfanta API

487.9M24](/packages/pagerfanta-core)[php-slang/php-slang

PHPSlang is a library that allow you to write a purely functional code in PHP

10627.2k2](/packages/php-slang-php-slang)[bisight/etl

BiSight ETL: Extract, Transform, Load toolkit

124.1k](/packages/bisight-etl)

PHPackages © 2026

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