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
1 changed files with 3 additions and 3 deletions

View File

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