PHPackages                             oldtimeguitarguy/laravel-event-subscriber - 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. oldtimeguitarguy/laravel-event-subscriber

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

oldtimeguitarguy/laravel-event-subscriber
=========================================

This makes your event subscribers a little cleaner

v1.1.2(9y ago)037MITPHP

Since Jul 9Pushed 9y agoCompare

[ Source](https://github.com/oldtimeguitarguy/laravel-event-subscriber)[ Packagist](https://packagist.org/packages/oldtimeguitarguy/laravel-event-subscriber)[ RSS](/packages/oldtimeguitarguy-laravel-event-subscriber/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)DependenciesVersions (5)Used By (0)

Laravel Event Subscriber
========================

[](#laravel-event-subscriber)

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

[](#installation)

1. `composer require oldtimeguitarguy/laravel-event-subscriber`
2. Add `OldTimeGuitarGuy\LaravelEventSubscriber\EventSubscriberProvider::class,` to the providers array in `config/app.php`
3. Run `php artisan vendor:publish` to copy the config file to `config/event_subscriber.php`

Usage
-----

[](#usage)

1. Create subscribers with `php artisan make:event-subscriber SubscriberName`
2. Add custom event classes in `config/event_subscriber.php`

Description
-----------

[](#description)

The basic premise of this evolved from [here](https://laravel.com/docs/5.2/events#event-subscribers).

I love the idea, but I don't like how you have to define that `subscribe` method.

This class eliminates that.

Basically create your event subscriber class just like the documentation says, but now, if you extend from this class, you never have to write the `subscribe` method.

Instead, just prefix all of your event names with `on` as public methods.

So you would do something like this:

```
class MyEventSubscriber extends EventSubscriber
{
    public function onUserLogin($event)
    {
        // do stuff
    }

    public function onUserLogout($event)
    {
        // do stuff
    }
}
```

That's it. There are a couple of caveats:
-----------------------------------------

[](#thats-it-there-are-a-couple-of-caveats)

1. It looks for the events in Laravel's `app/Events` directory. (or any class you add to the classmap in the config file)
2. You can have a maximum of **one** subdirectory under `app/Events/`
3. Be careful about name collisions, even if the event classes exist in different subdirectories under `app/Events`

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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

Every ~3 days

Total

4

Last Release

3634d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71b10d228fd9de25aebbdd68dd046f30891b73db996198131160d4e20555105c?d=identicon)[oldtimeguitarguy](/maintainers/oldtimeguitarguy)

---

Top Contributors

[![karlhepler](https://avatars.githubusercontent.com/u/791071?v=4)](https://github.com/karlhepler "karlhepler (1 commits)")

### Embed Badge

![Health badge](/badges/oldtimeguitarguy-laravel-event-subscriber/health.svg)

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

PHPackages © 2026

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