I have an event listener that uses a wild card to listen for any sentinel.user.*
event.
Here's the listener:
Event::listen('sentinel.user.*', function ($userID = null){
error_log('log listener fired');
$userLog = new UserLog;
$EventNameExploded = explode("." , Event::firing());
$EventNameEnding = array_pop($EventNameExploded);
$logAction = "User " . $EventNameEnding;
$logData = array('eventDescription' => $logAction);
$userLog->submitLog($logData,$userID);
},99);
For some reason this doesn't fire for the sentinel.user.forgot
event. It does fire for any other sentinel.user
event.
While troubleshooting, I added a listener for the specific sentinel.user.forgot
event:
Event::listen('sentinel.user.forgot', function (){
error_log('forgot listener fired');
}, 98);
This event listener will fire. I even gave it a priority that was lower than the log event and the log event will not fire but the forgot specific one will fire. I have no even listeners with a priority higher than 99
or 98
.
Does anyone know why the listener isn't firing???
EDIT:
Here's the code that fires the sentinel.user.forgot
event:
public function forgot()
{
// Form Processing
$result = $this->forgotPasswordForm->forgot( Input::all() );
if( $result['success'] )
{
Event::fire('sentinel.user.forgot', array(
'email' => $result['mailData']['email'],
'userId' => $result['mailData']['userId'],
'resetCode' => $result['mailData']['resetCode']
));
// Success!
Session::flash('success', $result['message']);
return Redirect::route('home');
}
else
{
Session::flash('error', $result['message']);
return Redirect::route('Sentinel\forgotPasswordForm')
->withInput()
->withErrors( $this->forgotPasswordForm->errors() );
}
}