diff --git a/authentication.md b/authentication.md
index 6d4dab993e2..e1a477e26af 100644
--- a/authentication.md
+++ b/authentication.md
@@ -586,4 +586,8 @@ Laravel raises a variety of [events](/docs/{{version}}/events) during the authen
'Illuminate\Auth\Events\Logout' => [
'App\Listeners\LogSuccessfulLogout',
],
+
+ 'Illuminate\Auth\Events\Lockout' => [
+ 'App\Listeners\LogLockout',
+ ],
];
diff --git a/billing.md b/billing.md
index 2bac13a30a5..121479889b3 100644
--- a/billing.md
+++ b/billing.md
@@ -215,7 +215,7 @@ To cancel a subscription, simply call the `cancel` method on the user's subscrip
$user->subscription('main')->cancel();
-When a subscription is cancelled, Cashier will automatically set the `subscription_ends_at` column in your database. This column is used to know when the `subscribed` method should begin returning `false`. For example, if a customer cancels a subscription on March 1st, but the subscription was not scheduled to end until March 5th, the `subscribed` method will continue to return `true` until March 5th.
+When a subscription is cancelled, Cashier will automatically set the `ends_at` column in your database. This column is used to know when the `subscribed` method should begin returning `false`. For example, if a customer cancels a subscription on March 1st, but the subscription was not scheduled to end until March 5th, the `subscribed` method will continue to return `true` until March 5th.
You may determine if a user has cancelled their subscription but are still on their "grace period" using the `onGracePeriod` method:
diff --git a/collections.md b/collections.md
index 0512d9c2a51..0ec76501adc 100644
--- a/collections.md
+++ b/collections.md
@@ -104,6 +104,8 @@ You may select any method from this table to see an example of its usage:
[values](#method-values)
[where](#method-where)
[whereLoose](#method-whereloose)
+[whereIn](#method-wherein)
+[whereInLoose](#method-whereinloose)
[zip](#method-zip)
@@ -1231,13 +1233,43 @@ The `where` method filters the collection by a given key / value pair:
]
*/
-The `where` method uses strict comparisons when checking item values. Use the [`whereLoose`](#where-loose) method to filter using "loose" comparisons.
+The `where` method uses strict comparisons when checking item values. Use the [`whereLoose`](#method-whereloose) method to filter using "loose" comparisons.
#### `whereLoose()` {#collection-method}
This method has the same signature as the [`where`](#method-where) method; however, all values are compared using "loose" comparisons.
+
+#### `whereIn()` {#collection-method}
+
+The `whereIn` method filters the collection by a given key / value contained within the given array.
+
+ $collection = collect([
+ ['product' => 'Desk', 'price' => 200],
+ ['product' => 'Chair', 'price' => 100],
+ ['product' => 'Bookcase', 'price' => 150],
+ ['product' => 'Door', 'price' => 100],
+ ]);
+
+ $filtered = $collection->whereIn('price', [150, 200]);
+
+ $filtered->all();
+
+ /*
+ [
+ ['product' => 'Bookcase', 'price' => 150],
+ ['product' => 'Desk', 'price' => 200],
+ ]
+ */
+
+The `whereIn` method uses strict comparisons when checking item values. Use the [`whereInLoose`](#method-whereinloose) method to filter using "loose" comparisons.
+
+
+#### `whereInLoose()` {#collection-method}
+
+This method has the same signature as the [`whereIn`](#method-wherein) method; however, all values are compared using "loose" comparisons.
+
#### `zip()` {#collection-method}
diff --git a/elixir.md b/elixir.md
index 2cd55ba3738..f368ffb3c25 100644
--- a/elixir.md
+++ b/elixir.md
@@ -198,7 +198,7 @@ elixir(function(mix) {
### Browserify
-Elixir also ships with a `browserify` method, which gives you all the benefits of requiring modules in the browser and using ECMAScript 6.
+Elixir also ships with a `browserify` method, which gives you all the benefits of requiring modules in the browser and using ECMAScript 6 and JSX.
This task assumes that your scripts are stored in `resources/assets/js` and will place the resulting file in `public/js/main.js`:
@@ -226,13 +226,14 @@ elixir(function(mix) {
### Babel
-The `babel` method may be used to compile [ECMAScript 6 and 7](https://babeljs.io/docs/learn-es2015/) into plain JavaScript. This function accepts an array of files relative to the `resources/assets/js` directory, and generates a single `all.js` file in the `public/js` directory:
+The `babel` method may be used to compile [ECMAScript 6 and 7](https://babeljs.io/docs/learn-es2015/) and [JSX](https://facebook.github.io/react/docs/jsx-in-depth.html) into plain JavaScript. This function accepts an array of files relative to the `resources/assets/js` directory, and generates a single `all.js` file in the `public/js` directory:
```javascript
elixir(function(mix) {
mix.babel([
'order.js',
- 'product.js'
+ 'product.js',
+ 'react-component.jsx'
]);
});
```
diff --git a/eloquent-relationships.md b/eloquent-relationships.md
index 39e26220d4a..15b040f15bd 100644
--- a/eloquent-relationships.md
+++ b/eloquent-relationships.md
@@ -767,6 +767,14 @@ For convenience, `attach` and `detach` also accept arrays of IDs as input:
$user->roles()->attach([1 => ['expires' => $expires], 2, 3]);
+#### Updating A Record On A Pivot Table
+
+If you need to update an existing row in your pivot table, you may use `updateExistingPivot` method:
+
+ $user = App\User::find(1);
+
+ $user->roles()->updateExistingPivot($roleId, $attributes);
+
#### Syncing For Convenience
You may also use the `sync` method to construct many-to-many associations. The `sync` method accepts an array of IDs to place on the intermediate table. Any IDs that are not in the given array will be removed from the intermediate table. So, after this operation is complete, only the IDs in the array will exist in the intermediate table:
diff --git a/eloquent.md b/eloquent.md
index 1952d5a618b..9537d4775a0 100644
--- a/eloquent.md
+++ b/eloquent.md
@@ -218,6 +218,10 @@ Of course, in addition to retrieving all of the records for a given table, you m
// Retrieve the first model matching the query constraints...
$flight = App\Flight::where('active', 1)->first();
+You may also call the `find` method with an array of primary keys, which will return a collection of the matching records:
+
+ $flights = App\Flight::find([1, 2, 3]);
+
#### Not Found Exceptions
Sometimes you may wish to throw an exception if a model is not found. This is particularly useful in routes or controllers. The `findOrFail` and `firstOrFail` methods will retrieve the first result of the query. However, if no result is found, a `Illuminate\Database\Eloquent\ModelNotFoundException` will be thrown:
diff --git a/encryption.md b/encryption.md
index 37dfeef6239..cf959d2c2c5 100644
--- a/encryption.md
+++ b/encryption.md
@@ -45,6 +45,8 @@ For example, we may use the `encrypt` method to encrypt a secret and store it on
}
}
+> **Note:** Encrypted values are passed through `serialize` during encryption, which allows for "encryption" of objects and arrays. Thus, non-PHP clients receiving encrypted values will need to `unserialize` the data.
+
#### Decrypting A Value
Of course, you may decrypt values using the `decrypt` method on the `Crypt` facade. If the value can not be properly decrypted, such as when the MAC is invalid, an `Illuminate\Contracts\Encryption\DecryptException` will be thrown:
diff --git a/helpers.md b/helpers.md
index df8f6b56232..7f8d918a860 100644
--- a/helpers.md
+++ b/helpers.md
@@ -242,7 +242,7 @@ The `array_has` function checks that a given item exists in an array using "dot"
$array = ['products' => ['desk' => ['price' => 100]]];
- $hasDesk = array_has($array, ['products.desk']);
+ $hasDesk = array_has($array, 'products.desk');
// true
diff --git a/installation.md b/installation.md
index d834dba03a9..6f56d22272e 100644
--- a/installation.md
+++ b/installation.md
@@ -34,7 +34,7 @@ First, download the Laravel installer using Composer:
composer global require "laravel/installer"
-Make sure to place the `~/.composer/vendor/bin` directory in your PATH so the `laravel` executable can be located by your system.
+Make sure to place the `~/.composer/vendor/bin` directory (or the equivalent directory for your OS) in your PATH so the `laravel` executable can be located by your system.
Once installed, the `laravel new` command will create a fresh Laravel installation in the directory you specify. For instance, `laravel new blog` will create a directory named `blog` containing a fresh Laravel installation with all of Laravel's dependencies already installed. This method of installation is much faster than installing via Composer:
@@ -57,7 +57,7 @@ After installing Laravel, you may need to configure some permissions. Directorie
#### Application Key
-The next thing you should do after installing Laravel is set your application key to a random string. If you installed Laravel via Composer or the Laravel installer, this key has already been set for you by the `key:generate` command. Typically, this string should be 32 characters long. The key can be set in the `.env` environment file. If you have not renamed the `.env.example` file to `.env`, you should do that now. **If the application key is not set, your user sessions and other encrypted data will not be secure!**
+The next thing you should do after installing Laravel is set your application key to a random string. If you installed Laravel via Composer or the Laravel installer, this key has already been set for you by the `artisan key:generate` command. Typically, this string should be 32 characters long. The key can be set in the `.env` environment file. If you have not renamed the `.env.example` file to `.env`, you should do that now. **If the application key is not set, your user sessions and other encrypted data will not be secure!**
#### Additional Configuration
diff --git a/queries.md b/queries.md
index c96c8a3e3e4..c622d873afc 100644
--- a/queries.md
+++ b/queries.md
@@ -88,9 +88,9 @@ You may stop further chunks from being processed by returning `false` from the `
#### Retrieving A List Of Column Values
-If you would like to retrieve an array containing the values of a single column, you may use the `lists` method. In this example, we'll retrieve an array of role titles:
+If you would like to retrieve an array containing the values of a single column, you may use the `pluck` method. In this example, we'll retrieve an array of role titles:
- $titles = DB::table('roles')->lists('title');
+ $titles = DB::table('roles')->pluck('title');
foreach ($titles as $title) {
echo $title;
@@ -98,7 +98,7 @@ If you would like to retrieve an array containing the values of a single column,
You may also specify a custom key column for the returned array:
- $roles = DB::table('roles')->lists('title', 'name');
+ $roles = DB::table('roles')->pluck('title', 'name');
foreach ($roles as $name => $title) {
echo $title;
diff --git a/queues.md b/queues.md
index 2d3d182a6e4..b72b2f0febd 100644
--- a/queues.md
+++ b/queues.md
@@ -6,7 +6,6 @@
- [Job Class Structure](#job-class-structure)
- [Pushing Jobs Onto The Queue](#pushing-jobs-onto-the-queue)
- [Delayed Jobs](#delayed-jobs)
- - [Dispatching Jobs From Requests](#dispatching-jobs-from-requests)
- [Job Events](#job-events)
- [Running The Queue Listener](#running-the-queue-listener)
- [Supervisor Configuration](#supervisor-configuration)
diff --git a/quickstart-intermediate.md b/quickstart-intermediate.md
index f50319c8632..c4648e29f1b 100644
--- a/quickstart-intermediate.md
+++ b/quickstart-intermediate.md
@@ -256,7 +256,7 @@ Now, all we have to do is add the authentication routes to our routes file. We c
Since we know we're going to need to retrieve and store tasks, let's create a `TaskController` using the Artisan CLI, which will place the new controller in the `app/Http/Controllers` directory:
- php artisan make:controller TaskController --plain
+ php artisan make:controller TaskController
Now that the controller has been generated, let's go ahead and stub out some routes in our `app/Http/routes.php` file to point to the controller:
diff --git a/scheduling.md b/scheduling.md
index 41150796b9b..f0dc5a55e1f 100644
--- a/scheduling.md
+++ b/scheduling.md
@@ -88,6 +88,7 @@ Method | Description
`->monthly();` | Run the task every month
`->quarterly();` | Run the task every quarter
`->yearly();` | Run the task every year
+`->timezone('America/New_York');` | Set the timezone
These methods may be combined with additional constraints to create even more finely tuned schedules that only run on certain days of the week. For example, to schedule a command to run weekly on Monday:
diff --git a/seeding.md b/seeding.md
index ef96666ba22..f4132726777 100644
--- a/seeding.md
+++ b/seeding.md
@@ -91,7 +91,7 @@ Once you have written your seeder classes, you may use the `db:seed` Artisan com
php artisan db:seed
- php artisan db:seed --class=UserTableSeeder
+ php artisan db:seed --class=UsersTableSeeder
You may also seed your database using the `migrate:refresh` command, which will also rollback and re-run all of your migrations. This command is useful for completely re-building your database:
diff --git a/upgrade.md b/upgrade.md
index 84c2322ca47..7df49261533 100644
--- a/upgrade.md
+++ b/upgrade.md
@@ -124,7 +124,7 @@ The `json` column type now creates actual JSON columns when used by the MySQL dr
#### Seeding
-When runnning database seeds, all Eloquent models are now unguarded by default. Previously a call to `Model::unguard()` was required. You can call `Model::reguard()` at the top of your `DatabaseSeeder` class if you would like models to be guarded during seeding.
+When running database seeds, all Eloquent models are now unguarded by default. Previously a call to `Model::unguard()` was required. You can call `Model::reguard()` at the top of your `DatabaseSeeder` class if you would like models to be guarded during seeding.
### Eloquent
@@ -161,6 +161,7 @@ Some of the core events fired by Laravel now use event objects instead of string
Old | New
------------- | -------------
+`artisan.start` | `Illuminate\Console\Events\ArtisanStarting`
`auth.attempting` | `Illuminate\Auth\Events\Attempting`
`auth.login` | `Illuminate\Auth\Events\Login`
`auth.logout` | `Illuminate\Auth\Events\Logout`
diff --git a/validation.md b/validation.md
index 6c4092f22ba..2165b68f9e3 100644
--- a/validation.md
+++ b/validation.md
@@ -103,6 +103,17 @@ To get a better understanding of the `validate` method, let's jump back into the
As you can see, we simply pass the incoming HTTP request and desired validation rules into the `validate` method. Again, if the validation fails, the proper response will automatically be generated. If the validation passes, our controller will continue executing normally.
+#### Stopping On First Validation Failure
+
+Sometimes you may wish to stop running validation rules on an attribute after the first validation failure. To do so, assign the `bail` rule to the attribute:
+
+ $this->validate($request, [
+ 'title' => 'bail|required|unique:posts|max:255',
+ 'body' => 'required',
+ ]);
+
+In this example, if the `required` rule on the `title` attribute fails, the `unique` rule will not be checked. Rules will be validated in the order they are assigned.
+
#### A Note On Nested Attributes
If your HTTP request contains "nested" parameters, you may specify them in your validation rules using "dot" syntax: