dwightwatson / validating

Automatically validating Eloquent models for Laravel
MIT License
968 stars 76 forks source link

Event listener on L5 #145

Closed JavoByte closed 8 years ago

JavoByte commented 8 years ago

Hi. I'm trying to attach an event listener to the validating event but I do not find out how. I copy&pasted the code for Event::listen and the $observables array in my model. Yet, the event is not being handled properly. What am I missing. I'm using Laravel 5.1.24

dwightwatson commented 8 years ago

Whoops, looked like an issue with the docs. I've fixed it up now.

The event you should listen for is actually eloquent.validating:* - not the use of a colon instead of a period before the asterisk.