The event should come after the logic as per the developer guidelines. If the event comes before the logic, it should be called beforeLogin. In this case, beforeLogin doesn't make sense, so just move the event after the parent::afterLogin call.
This commit is contained in:
Samuel Georges 2016-02-27 14:07:21 +11:00
parent 48148cfcd0
commit d58a8478f6

View File

@ -1,9 +1,9 @@
<?php namespace Backend\Models;
use Mail;
use Event;
use Backend;
use October\Rain\Auth\Models\User as UserBase;
use Event;
/**
* Administrator user model
@ -108,11 +108,11 @@ class User extends UserBase
$this->sendInvitation();
}
}
public function afterLogin()
{
Event::fire('backend.user.login', [$this]);
parent::afterLogin();
Event::fire('backend.user.login', [$this]);
}
public function sendInvitation()