Download the PHP package oldtimeguitarguy/laravel-event-subscriber without Composer
On this page you can find all versions of the php package oldtimeguitarguy/laravel-event-subscriber. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download oldtimeguitarguy/laravel-event-subscriber
More information about oldtimeguitarguy/laravel-event-subscriber
Files in oldtimeguitarguy/laravel-event-subscriber
Download oldtimeguitarguy/laravel-event-subscriber
More information about oldtimeguitarguy/laravel-event-subscriber
Files in oldtimeguitarguy/laravel-event-subscriber
Vendor oldtimeguitarguy
Package laravel-event-subscriber
Short Description This makes your event subscribers a little cleaner
License MIT
Package laravel-event-subscriber
Short Description This makes your event subscribers a little cleaner
License MIT
Please rate this library. Is it a good library?
Informations about the package laravel-event-subscriber
Laravel Event Subscriber
Installation
composer require oldtimeguitarguy/laravel-event-subscriber
- Add
OldTimeGuitarGuy\LaravelEventSubscriber\EventSubscriberProvider::class,
to the providers array inconfig/app.php
- Run
php artisan vendor:publish
to copy the config file toconfig/event_subscriber.php
Usage
- Create subscribers with
php artisan make:event-subscriber SubscriberName
- Add custom event classes in
config/event_subscriber.php
Description
The basic premise of this evolved from here.
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:
That's it. There are a couple of caveats:
- It looks for the events in Laravel's
app/Events
directory. (or any class you add to the classmap in the config file) - You can have a maximum of one subdirectory under
app/Events/
- Be careful about name collisions, even if the event classes exist in different subdirectories under
app/Events
All versions of laravel-event-subscriber with dependencies
PHP Build Version
Package Version
No informations.
The package oldtimeguitarguy/laravel-event-subscriber contains the following files
Loading the files please wait ....