Skip to content

Commit

Permalink
Merge pull request laravel#979 from Kyslik/4.2
Browse files Browse the repository at this point in the history
Update events.md & validation.md
  • Loading branch information
taylorotwell committed Dec 19, 2014
2 parents 93d5f27 + c72a4d0 commit 9b79b90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions events.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ The Laravel `Event` class provides a simple observer implementation, allowing yo

#### Firing An Event

$event = Event::fire('auth.login', array($user));
$response = Event::fire('auth.login', array($user));

The `fire` method returns an array of responses that you can use to control what happens next in your application.

#### Subscribing To Events With Priority

Expand All @@ -47,7 +49,9 @@ Sometimes, you may wish to stop the propagation of an event to other listeners.

So, you know how to register events, but you may be wondering _where_ to register them. Don't worry, this is a common question. Unfortunately, it's a hard question to answer because you can register an event almost anywhere! But, here are some tips. Again, like most other bootstrapping code, you may register events in one of your `start` files such as `app/start/global.php`.

If your `start` files are getting too crowded, you could create a separate `app/events.php` file that is included from a `start` file. This is a simple solution that keeps your event registration cleanly separated from the rest of your bootstrapping. If you prefer a class based approach, you may register your events in a [service provider](/docs/ioc#service-providers). Since none of these approaches is inherently "correct", choose an approach you feel comfortable with based on the size of your application.
If your `start` files are getting too crowded, you could create a separate `app/events.php` file that is included from a `start` file. This is a simple solution that keeps your event registration cleanly separated from the rest of your bootstrapping.

If you prefer a class based approach, you may register your events in a [service provider](/docs/ioc#service-providers). Since none of these approaches is inherently "correct", choose an approach you feel comfortable with based on the size of your application.

<a name="wildcard-listeners"></a>
## Wildcard Listeners
Expand Down
4 changes: 2 additions & 2 deletions validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ The field under validation must be formatted as an IP address.
<a name="rule-max"></a>
#### max:_value_

The field under validation must be less than or equal to a maximum _value_. Strings, numerics, and files are evaluated in the same fashion as the `size` rule.
The field under validation must be less than or equal to a maximum _value_. Strings, numerics, and files are evaluated in the same fashion as the [`size`](#rule-size) rule.

<a name="rule-mimes"></a>
#### mimes:_foo_,_bar_,...
Expand All @@ -336,7 +336,7 @@ The file under validation must have a MIME type corresponding to one of the list
<a name="rule-min"></a>
#### min:_value_

The field under validation must have a minimum _value_. Strings, numerics, and files are evaluated in the same fashion as the `size` rule.
The field under validation must have a minimum _value_. Strings, numerics, and files are evaluated in the same fashion as the [`size`](#rule-size) rule.

<a name="rule-not-in"></a>
#### not_in:_foo_,_bar_,...
Expand Down

0 comments on commit 9b79b90

Please sign in to comment.