Add 'laravel.auth: login' and 'laravel.auth: logout' events.

Signed-off-by: crynobone <crynobone@gmail.com>
This commit is contained in:
crynobone 2012-11-29 22:07:10 +08:00
parent 6140089eb3
commit ba661e5768
1 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,7 @@
use Laravel\Str; use Laravel\Str;
use Laravel\Cookie; use Laravel\Cookie;
use Laravel\Config; use Laravel\Config;
use Laravel\Event;
use Laravel\Session; use Laravel\Session;
use Laravel\Crypter; use Laravel\Crypter;
@ -112,6 +113,8 @@ public function login($token, $remember = false)
if ($remember) $this->remember($token); if ($remember) $this->remember($token);
Event::fire('laravel.auth: login');
return true; return true;
} }
@ -128,6 +131,8 @@ public function logout()
Session::forget($this->token()); Session::forget($this->token());
Event::fire('laravel.auth: logout');
$this->token = null; $this->token = null;
} }