Gonçalo Marrafa
Gonçalo Marrafa

Reputation: 2113

Laravel Eloquent model events

I want to handle eloquent events. If i register a listener for a wildcard event 'eloquent.*' the handler callback takes, as parameter, the model instance that fired the event.

How can i find out the exact event that was fired?

Thanks in advance.

PS: i'm using Laravel 5.2.

Upvotes: 1

Views: 199

Answers (1)

Nick
Nick

Reputation: 2214

The event is available from the dispatcher via its firing() method.

Using the Event facade, you'd call Event::firing().

Upvotes: 1

Related Questions