Browse Source

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

Signed-off-by: crynobone <crynobone@gmail.com>
crynobone 12 years ago
parent
commit
ba661e5768
1 changed files with 5 additions and 0 deletions
  1. 5 0
      laravel/auth/drivers/driver.php

+ 5 - 0
laravel/auth/drivers/driver.php

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