Skip to content

Commit 596b4a1

Browse files
committed
Fixing auth events.
1 parent ac076e6 commit 596b4a1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

events.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The Laravel `Event` class provides a simple observer implementation, allowing yo
1313

1414
#### Subscribing To An Event
1515

16-
Event::listen('user.login', function($user)
16+
Event::listen('auth.login', function($user)
1717
{
1818
$user->last_login = new DateTime;
1919

@@ -22,21 +22,21 @@ The Laravel `Event` class provides a simple observer implementation, allowing yo
2222

2323
#### Firing An Event
2424

25-
$event = Event::fire('user.login', array($user));
25+
$event = Event::fire('auth.login', array($user));
2626

2727
You may also specify a priority when subscribing to events. Listeners with higher priority will be run first, while listeners that have the same priority will be run in order of subscription.
2828

2929
#### Subscribing To Events With Priority
3030

31-
Event::listen('user.login', 'LoginHandler', 10);
31+
Event::listen('auth.login', 'LoginHandler', 10);
3232

33-
Event::listen('user.login', 'OtherHandler', 5);
33+
Event::listen('auth.login', 'OtherHandler', 5);
3434

3535
Sometimes, you may wish to stop the propagation of an event to other listeners. You may do so using by returning `false` from your listener:
3636

3737
#### Stopping The Propagation Of An Event
3838

39-
Event::listen('user.login', function($event)
39+
Event::listen('auth.login', function($event)
4040
{
4141
// Handle the event...
4242

@@ -80,7 +80,7 @@ In some cases, you may wish to use a class to handle an event rather than a Clos
8080

8181
#### Registering A Class Listener
8282

83-
Event::listen('user.login', 'LoginHandler');
83+
Event::listen('auth.login', 'LoginHandler');
8484

8585
By default, the `handle` method on the `LoginHandler` class will be called:
8686

@@ -99,7 +99,7 @@ If you do not wish to use the default `handle` method, you may specify the metho
9999

100100
#### Specifying Which Method To Subscribe
101101

102-
Event::listen('user.login', 'LoginHandler@onLogin');
102+
Event::listen('auth.login', 'LoginHandler@onLogin');
103103

104104
<a name="queued-events"></a>
105105
## Queued Events
@@ -154,9 +154,9 @@ Event subscribers are classes that may subscribe to multiple events from within
154154
*/
155155
public function subscribe($events)
156156
{
157-
$events->listen('user.login', 'UserEventHandler@onUserLogin');
157+
$events->listen('auth.login', 'UserEventHandler@onUserLogin');
158158

159-
$events->listen('user.logout', 'UserEventHandler@onUserLogout');
159+
$events->listen('auth.logout', 'UserEventHandler@onUserLogout');
160160
}
161161

162162
}

0 commit comments

Comments
 (0)