You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: events.md
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ The Laravel `Event` class provides a simple observer implementation, allowing yo
13
13
14
14
#### Subscribing To An Event
15
15
16
-
Event::listen('user.login', function($user)
16
+
Event::listen('auth.login', function($user)
17
17
{
18
18
$user->last_login = new DateTime;
19
19
@@ -22,21 +22,21 @@ The Laravel `Event` class provides a simple observer implementation, allowing yo
22
22
23
23
#### Firing An Event
24
24
25
-
$event = Event::fire('user.login', array($user));
25
+
$event = Event::fire('auth.login', array($user));
26
26
27
27
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.
28
28
29
29
#### Subscribing To Events With Priority
30
30
31
-
Event::listen('user.login', 'LoginHandler', 10);
31
+
Event::listen('auth.login', 'LoginHandler', 10);
32
32
33
-
Event::listen('user.login', 'OtherHandler', 5);
33
+
Event::listen('auth.login', 'OtherHandler', 5);
34
34
35
35
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:
36
36
37
37
#### Stopping The Propagation Of An Event
38
38
39
-
Event::listen('user.login', function($event)
39
+
Event::listen('auth.login', function($event)
40
40
{
41
41
// Handle the event...
42
42
@@ -80,7 +80,7 @@ In some cases, you may wish to use a class to handle an event rather than a Clos
80
80
81
81
#### Registering A Class Listener
82
82
83
-
Event::listen('user.login', 'LoginHandler');
83
+
Event::listen('auth.login', 'LoginHandler');
84
84
85
85
By default, the `handle` method on the `LoginHandler` class will be called:
86
86
@@ -99,7 +99,7 @@ If you do not wish to use the default `handle` method, you may specify the metho
0 commit comments