Merge branch '5.6' of github.com:laravel/docs into 5.6

This commit is contained in:
Taylor Otwell 2018-04-17 07:23:17 -05:00
commit 43ae7d55b9
5 changed files with 89 additions and 13 deletions

View File

@ -403,7 +403,7 @@ You may also manually register commands by adding its class name to the `$comman
<a name="programmatically-executing-commands"></a>
## Programmatically Executing Commands
Sometimes you may wish to execute an Artisan command outside of the CLI. For example, you may wish to fire an Artisan command from a route or controller. You may use the `call` method on the `Artisan` facade to accomplish this. The `call` method accepts the name of the command as the first argument, and an array of command parameters as the second argument. The exit code will be returned:
Sometimes you may wish to execute an Artisan command outside of the CLI. For example, you may wish to fire an Artisan command from a route or controller. You may use the `call` method on the `Artisan` facade to accomplish this. The `call` method accepts either the command's name or class as the first argument, and an array of command parameters as the second argument. The exit code will be returned:
Route::get('/foo', function () {
$exitCode = Artisan::call('email:send', [

View File

@ -76,7 +76,7 @@ This is identical to manually defining the following Gate definitions:
Gate::define('posts.update', 'App\Policies\PostPolicy@update');
Gate::define('posts.delete', 'App\Policies\PostPolicy@delete');
By default, the `view`, `create`, `update`, and `delete` abilities will be defined. You may override or add to the default abilities by passing an array as a third argument to the `resource` method. The keys of the array define the names of the abilities while the values define the method names. For example, the following code will create two new Gate definitions - `posts.image` and `posts.photo`:
By default, the `view`, `create`, `update`, and `delete` abilities will be defined. You may override the default abilities by passing an array as a third argument to the `resource` method. The keys of the array define the names of the abilities while the values define the method names. For example, the following code will only create two new Gate definitions - `posts.image` and `posts.photo`:
Gate::resource('posts', 'PostPolicy', [
'image' => 'updateImage',

84
dusk.md
View File

@ -576,8 +576,10 @@ Dusk provides a variety of assertions that you may make against your application
[assertPathIsNot](#assert-path-is-not)
[assertRouteIs](#assert-route-is)
[assertQueryStringHas](#assert-query-string-has)
[assertQueryStringHas](#assert-query-string-has)
[assertQueryStringMissing](#assert-query-string-missing)
[assertFragmentIs](#assert-fragment-is)
[assertFragmentBeginsWith](#assert-fragment-begins-with)
[assertFragmentIsNot](#assert-fragment-is-not)
[assertHasCookie](#assert-has-cookie)
[assertCookieMissing](#assert-cookie-missing)
[assertCookieValue](#assert-cookie-value)
@ -603,10 +605,17 @@ Dusk provides a variety of assertions that you may make against your application
[assertSelectHasOption](#assert-select-has-option)
[assertValue](#assert-value)
[assertVisible](#assert-visible)
[assertPresent](#assert-present)
[assertMissing](#assert-missing)
[assertDialogOpened](#assert-dialog-opened)
[assertEnabled](#assert-enabled)
[assertDisabled](#assert-disabled)
[assertFocused](#assert-focused)
[assertNotFocused](#assert-not-focused)
[assertVue](#assert-vue)
[assertVueIsNot](#assert-vue-is-not)
[assertVueContains](#assert-vue-contains)
[assertVueDoesNotContain](#assert-vue-does-not-contain)
</div>
<a name="assert-title"></a>
@ -665,9 +674,6 @@ Assert the given query string parameter is present:
$browser->assertQueryStringHas($name);
<a name="assert-query-string-has"></a>
#### assertQueryStringHas
Assert the given query string parameter is present and has a given value:
$browser->assertQueryStringHas($name, $value);
@ -678,6 +684,27 @@ Assert the given query string parameter is present and has a given value:
Assert the given query string parameter is missing:
$browser->assertQueryStringMissing($name);
<a name="assert-fragment-is"></a>
#### assertFragmentIs
Assert the current fragment matches the given fragment:
$browser->assertFragmentIs('anchor');
<a name="assert-fragment-begins-with"></a>
#### assertFragmentBeginsWith
Assert that the current fragment begins with given fragment:
$browser->assertFragmentBeginsWith('anchor');
<a name="assert-fragment-is-not"></a>
#### assertFragmentIsNot
Assert the current fragment does not match the given fragment:
$browser->assertFragmentIsNot('anchor');
<a name="assert-has-cookie"></a>
#### assertHasCookie
@ -854,6 +881,13 @@ Assert the element matching the given selector is visible:
$browser->assertVisible($selector);
<a name="assert-present"></a>
#### assertPresent
Assert the element matching the given selector is present:
$browser->assertPresent($selector);
<a name="assert-missing"></a>
#### assertMissing
@ -868,6 +902,34 @@ Assert that a JavaScript dialog with given message has been opened:
$browser->assertDialogOpened($message);
<a name="assert-enabled"></a>
#### assertEnabled
Assert that the given field is enabled:
$browser->assertEnabled($field);
<a name="assert-disabled"></a>
#### assertDisabled
Assert that the given field is disabled:
$browser->assertDisabled($field);
<a name="assert-focused"></a>
#### assertFocused
Assert that the given field is focused:
$browser->assertFocused($field);
<a name="assert-not-focused"></a>
#### assertNotFocused
Assert that the given field is not focused:
$browser->assertNotFocused($field);
<a name="assert-vue"></a>
#### assertVue
@ -882,6 +944,20 @@ Assert that a given Vue component data property does not match the given value:
$browser->assertVueIsNot($property, $value, $componentSelector = null);
<a name="assert-vue-contains"></a>
#### assertVueContains
Assert that a given Vue component data property is an array and contains the given value:
$browser->assertVueContains($property, $value, $componentSelector = null);
<a name="assert-vue-does-not-contain"></a>
#### assertVueDoesNotContain
Assert that a given Vue component data property is an array and does not contain the given value:
$browser->assertVueDoesNotContain($property, $value, $componentSelector = null);
<a name="pages"></a>
## Pages

View File

@ -36,13 +36,13 @@ To get started, let's create an Eloquent model. Models typically live in the `ap
The easiest way to create a model instance is using the `make:model` [Artisan command](/docs/{{version}}/artisan):
php artisan make:model User
php artisan make:model Flight
If you would like to generate a [database migration](/docs/{{version}}/migrations) when you generate the model, you may use the `--migration` or `-m` option:
php artisan make:model User --migration
php artisan make:model Flight --migration
php artisan make:model User -m
php artisan make:model Flight -m
<a name="eloquent-model-conventions"></a>
### Eloquent Model Conventions
@ -627,7 +627,7 @@ Eloquent also allows you to define global scopes using Closures, which is partic
If you would like to remove a global scope for a given query, you may use the `withoutGlobalScope` method. The method accepts the class name of the global scope as its only argument:
User::withoutGlobalScope(AgeScope::class)->get();
Or, if you defined the global scope using a Closure:
User::withoutGlobalScope('age')->get();

View File

@ -60,7 +60,7 @@ You may use the `withHeaders` method to customize the request's headers before i
])->json('POST', '/user', ['name' => 'Sally']);
$response
->assertStatus(200)
->assertStatus(201)
->assertJson([
'created' => true,
]);
@ -126,7 +126,7 @@ Laravel also provides several helpers for testing JSON APIs and their responses.
$response = $this->json('POST', '/user', ['name' => 'Sally']);
$response
->assertStatus(200)
->assertStatus(201)
->assertJson([
'created' => true,
]);
@ -154,7 +154,7 @@ If you would like to verify that the given array is an **exact** match for the J
$response = $this->json('POST', '/user', ['name' => 'Sally']);
$response
->assertStatus(200)
->assertStatus(201)
->assertExactJson([
'created' => true,
]);