mardi 12 janvier 2016

How to listen for an event in Laravel 5.2?

I have a Laravel package that fires an event which is located in the vendor folder.

The event's class that is being fired is Mikea\Kicker\Events\Interviews\SurveyWasCompleted

I need to listen in for that event and then die and dump the event's object.

I added the following code in my routes.php file

Event::listen('Mikea\Kicker\Events\Interviews\SurveyWasCompleted', function($event){
    dd($event);
});

However, nothing is displayed on the screen. I know for sure that the SurveyWasCompleted event is called because when I die and dump from inside the event I get the data.

How can I correctly listen for an event to be fired?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire