PHPackages                             sarfraznawaz2005/eventable - 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. sarfraznawaz2005/eventable

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

sarfraznawaz2005/eventable
==========================

Laravel 5 package to easily add event listening capabilities to any model on Create/Update/Delete operations.

1.0.0(8y ago)3491MITPHPPHP &gt;=5.6

Since Sep 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/sarfraznawaz2005/eventable)[ Packagist](https://packagist.org/packages/sarfraznawaz2005/eventable)[ RSS](/packages/sarfraznawaz2005-eventable/feed)WikiDiscussions master Synced 3w ago

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

Laravel Eventable
=================

[](#laravel-eventable)

[![laravel 5.1](https://camo.githubusercontent.com/1f4d2790f2add6b3b71ce100b93c35955f0993e151c9cf79685b3dd28b50e97c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e312d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![laravel 5.2](https://camo.githubusercontent.com/33b59be6568a8c230ecc95a46aab2ba7752868f398a34b64c99bfbd8f2790a58/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e322d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![laravel 5.3](https://camo.githubusercontent.com/a7e1cdf9092e9addc80026f4f37eb963e539defda9a1f3276d088424c84e0a4b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e332d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![laravel 5.4](https://camo.githubusercontent.com/00fa09e19cad4128ef5cee38a4f2ecafffa3a629241ce7481e483c617a2c54bc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e342d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![downloads](https://camo.githubusercontent.com/b45a873ee0245ee4fd2601770322fb677e444d2120fb345bdb9e1bc8fcd2f06a/68747470733a2f2f706f7365722e707567782e6f72672f7361726672617a6e6177617a323030352f6576656e7461626c652f646f776e6c6f616473)](https://packagist.org/packages/sarfraznawaz2005/eventable)

Introduction
------------

[](#introduction)

Simple Laravel 5 package to easily add event listening capabilities to any model on Create/Update/Delete operations.

Requirements
------------

[](#requirements)

- PHP &gt;= 5.6
- Laravel 5

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

[](#installation)

Install via composer

```
composer require sarfraznawaz2005/eventable

```

That's it!

Usage
-----

[](#usage)

Suppose you have a model called `Task` and you want to be able to do something when it's created/updated or deleted. To do that, just use the `Eventable` trait like so:

```
...
use Sarfraznawaz2005\Eventable\Eventable;

class Task extends Model
{
    use Eventable;

    ...
}

```

Now somewhere in your app, you can listen to events and do whatever you want:

```
Event::listen('task.created', function ($task) {
    // do something when task is created. In this case, just log it.
    Log::info('Task with id ' . $task->id . ' was created.');
});

Event::listen('task.updated', function ($task) {
    // do something when task is updated. In this case, just log it.
    Log::info('Task with id ' . $task->id . ' was updated.');
});

Event::listen('task.deleted', function ($task) {
    // do something when task is deleted. In this case, just log it.
    Log::info('Task with id ' . $task->id . ' was deleted.');
});

```

**Note:** Make sure your put event listening logic BEFORE saving/updating/deletng model logic.

License
-------

[](#license)

This code is published under the [MIT License](http://opensource.org/licenses/MIT). This means you can do almost anything with it, as long as the copyright notice and the accompanying license file is left intact.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

3202d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f9bbcf3a6cda5f8bdf9afe10c20f5c6f563fc1a4d628a9af25c5fdec3f9c216?d=identicon)[sarfraznawaz2005](/maintainers/sarfraznawaz2005)

---

Top Contributors

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

---

Tags

eloquenteventslaravellaravel-5-packagemodelphpeventlaravelmodeleloquent

### Embed Badge

![Health badge](/badges/sarfraznawaz2005-eventable/health.svg)

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

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.0M87](/packages/mongodb-laravel-mongodb)[prettus/l5-repository

Laravel 8|9|10|11|12|13 - Repositories to the database layer

4.2k11.2M153](/packages/prettus-l5-repository)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k29.9M42](/packages/kirschbaum-development-eloquent-power-joins)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k5.0M31](/packages/tucker-eric-eloquentfilter)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591452.8k2](/packages/spiritix-lada-cache)[dyrynda/laravel-model-uuid

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

4833.0M9](/packages/dyrynda-laravel-model-uuid)

PHPackages © 2026

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