Skip to content

Commit

Permalink
2021-09-06までの原文変更点反映。
Browse files Browse the repository at this point in the history
  • Loading branch information
HiroKws committed Sep 6, 2021
1 parent ba93277 commit 57bb770
Show file tree
Hide file tree
Showing 27 changed files with 176 additions and 31 deletions.
8 changes: 4 additions & 4 deletions original-en/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Your application's authentication configuration file is located at `config/auth.

Want to get started fast? Install a [Laravel application starter kit](/docs/{{version}}/starter-kits) in a fresh Laravel application. After migrating your database, navigate your browser to `/register` or any other URL that is assigned to your application. The starter kits will take care of scaffolding your entire authentication system!

**Even if you choose to not use a starter kit in your final Laravel application, installing the [Laravel Breeze](/docs/{{version}}/starter-kits#laravel-breeze) starter kit can be a wonderful opportunity to learn how to implement all of Laravel's authentication functionality in an actual Laravel project.** Since Laravel Breeze creates authentication controllers, routes, and views for you, you can examine the code within these files to learn how Laravel's authentication features may be implemented.
**Even if you choose not to use a starter kit in your final Laravel application, installing the [Laravel Breeze](/docs/{{version}}/starter-kits#laravel-breeze) starter kit can be a wonderful opportunity to learn how to implement all of Laravel's authentication functionality in an actual Laravel project.** Since Laravel Breeze creates authentication controllers, routes, and views for you, you can examine the code within these files to learn how Laravel's authentication features may be implemented.

<a name="introduction-database-considerations"></a>
### Database Considerations
Expand Down Expand Up @@ -217,7 +217,7 @@ If you are using the Laravel Breeze or Laravel Jetstream [starter kits](/docs/{{
<a name="authenticating-users"></a>
## Manually Authenticating Users

You are not required to use the authentication scaffolding included with Laravel's [application starter kits](/docs/{{version}}/starter-kits). If you choose to not use this scaffolding, you will need to manage user authentication using the Laravel authentication classes directly. Don't worry, it's a cinch!
You are not required to use the authentication scaffolding included with Laravel's [application starter kits](/docs/{{version}}/starter-kits). If you choose not to use this scaffolding, you will need to manage user authentication using the Laravel authentication classes directly. Don't worry, it's a cinch!

We will access Laravel's authentication services via the `Auth` [facade](/docs/{{version}}/facades), so we'll need to make sure to import the `Auth` facade at the top of the class. Next, let's check out the `attempt` method. The `attempt` method is normally used to handle authentication attempts from your application's "login" form. If authentication is successful, you should regenerate the user's [session](/docs/{{version}}/session) to prevent [session fixation](https://en.wikipedia.org/wiki/Session_fixation):

Expand Down Expand Up @@ -403,7 +403,7 @@ In addition to calling the `logout` method, it is recommended that you invalidat
/**
* Log the user out of the application.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function logout(Request $request)
Expand Down Expand Up @@ -456,7 +456,7 @@ After confirming their password, a user will not be asked to confirm their passw
<a name="the-password-confirmation-form"></a>
#### The Password Confirmation Form

First, we will define a route to display a view that requests that the user confirm their password:
First, we will define a route to display a view that requests the user to confirm their password:

Route::get('/confirm-password', function () {
return view('auth.confirm-password');
Expand Down
2 changes: 1 addition & 1 deletion original-en/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ When writing Blade templates, you may wish to display a portion of the page only
@cannot('update', $post)
<!-- The current user cannot update the post... -->
@elsecannot('create', App\Models\Post::class)
<!-- The current user can now create new posts... -->
<!-- The current user cannot create new posts... -->
@endcannot
```

Expand Down
2 changes: 2 additions & 0 deletions original-en/billing.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ Typically, when your application's users update their name, email address, or ot

To automate this, you may define an event listener on your billable model that reacts to the model's `updated` event. Then, within your event listener, you may invoke the `syncStripeCustomerDetails` method on the model:

use function Illuminate\Events\queueable;

/**
* The "booted" method of the model.
*
Expand Down
8 changes: 8 additions & 0 deletions original-en/eloquent-mutators.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Attribute Casting](#attribute-casting)
- [Array & JSON Casting](#array-and-json-casting)
- [Date Casting](#date-casting)
- [Encrypted Casting](#encrypted-casting)
- [Query Time Casting](#query-time-casting)
- [Custom Casts](#custom-casts)
- [Value Object Casting](#value-object-casting)
Expand Down Expand Up @@ -300,6 +301,13 @@ By default, the `date` and `datetime` casts will serialize dates to a UTC ISO-86

If a custom format is applied to the `date` or `datetime` cast, such as `datetime:Y-m-d H:i:s`, the inner timezone of the Carbon instance will be used during date serialization. Typically, this will be the timezone specified in your application's `timezone` configuration option.

<a name="encrypted-casting"></a>
### Encrypted Casting

The `encrypted` cast will encrypt a model's attribute value using Laravel's built-in [encryption](/docs/{{version}}/encryption) features. In addition, the `encrypted:array`, `encrypted:collection`, and `encrypted:object` casts work like their unencrypted counterparts; however, as you might expect, the underlying value is encrypted when stored in your database.

As the final length of the encrypted text is not predictable and is longer than its plain text counterpart, make sure the associated database column is of `TEXT` type or larger. In addition, since the values are encrypted in the database, you will not be able to query or search encrypted attribute values.

<a name="query-time-casting"></a>
### Query Time Casting

Expand Down
15 changes: 15 additions & 0 deletions original-en/eloquent-relationships.md
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,21 @@ If you need even more power, you may use the `whereHas` and `orWhereHas` methods

> {note} Eloquent does not currently support querying for relationship existence across databases. The relationships must exist within the same database.
<a name="inline-relationship-existence-queries"></a>
#### Inline Relationship Existence Queries

If you would like to query for a relationship's existence with a single, simple where condition attached to the relationship query, you may find it more convenient to use the `whereRelation` and `whereMorphRelation` methods. For example, we may query for all posts that have unapproved comments:

use App\Models\Post;

$posts = Post::whereRelation('comments', 'is_approved', false)->get();

Of course, like calls to the query builder's `where` method, you may also specify an operator:

$posts = Post::whereRelation(
'comments', 'created_at', '>=', now()->subHour()
)->get();

<a name="querying-relationship-absence"></a>
### Querying Relationship Absence

Expand Down
2 changes: 1 addition & 1 deletion original-en/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ If your event listener methods are defined within the subscriber itself, you may
* Register the listeners for the subscriber.
*
* @param \Illuminate\Events\Dispatcher $events
* @return void
* @return array
*/
public function subscribe($events)
{
Expand Down
6 changes: 3 additions & 3 deletions original-en/homestead.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ Homestead runs on any Windows, macOS, or Linux system and includes Nginx, PHP, M
- PHP 7.0
- PHP 5.6
- Nginx
- MySQL (8.0)
- MySQL 8.0
- lmm
- Sqlite3
- PostgreSQL (9.6, 10, 11, 12, 13)
- PostgreSQL 13
- Composer
- Node (With Yarn, Bower, Grunt, and Gulp)
- Redis
Expand Down Expand Up @@ -255,7 +255,7 @@ Homestead starts several services by default; however, you may customize which s
```yaml
services:
- enabled:
- "postgresql@12-main"
- "postgresql"
- disabled:
- "mysql"
```
Expand Down
2 changes: 1 addition & 1 deletion original-en/http-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ You may specify multiple types using the `|` character, or passing an array of t
->whereType('id', ['string', 'integer'])
);

The `whereType` and `whereTypeAll` methods recognize the following types: `string`, `integer`, `double`, `boolean`, `array`, and `null`.
The `whereType` and `whereAllType` methods recognize the following types: `string`, `integer`, `double`, `boolean`, `array`, and `null`.

<a name="testing-file-uploads"></a>
## Testing File Uploads
Expand Down
4 changes: 1 addition & 3 deletions original-en/lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ The method signature for the HTTP kernel's `handle` method is quite simple: it r

One of the most important kernel bootstrapping actions is loading the [service providers](/docs/{{version}}/providers) for your application. All of the service providers for the application are configured in the `config/app.php` configuration file's `providers` array.

Laravel will iterate through this list of providers and instantiate each of them. After instantiating the providers, the `register` method will be called on all of the providers. Then, once all of the providers have been registered, the `boot` method will be called on each provider.
Laravel will iterate through this list of providers and instantiate each of them. After instantiating the providers, the `register` method will be called on all of the providers. Then, once all of the providers have been registered, the `boot` method will be called on each provider. This is so service providers may depend on every container binding being registered and available by the time their `boot` method is executed.

Service providers are responsible for bootstrapping all of the framework's various components, such as the database, queue, validation, and routing components. Essentially every major feature offered by Laravel is bootstrapped and configured by a service provider. Since they bootstrap and configure so many features offered by the framework, service providers are the most important aspect of the entire Laravel bootstrap process.

You may be wondering why the `register` method of every service provider is called before calling the `boot` method on any service providers. The answer is simple. By calling the `register` method of every service provider first, service providers may depend on every container binding being registered and available by the time the `boot` method is executed.

<a name="routing"></a>
### Routing

Expand Down
3 changes: 2 additions & 1 deletion original-en/migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ The `tinyIncrements` method creates an auto-incrementing `UNSIGNED TINYINT` equi
The `tinyInteger` method creates a `TINYINT` equivalent column:

$table->tinyInteger('votes');

<a name="column-method-tinyText"></a>
#### `tinyText()` {#collection-method}

Expand Down Expand Up @@ -1157,3 +1157,4 @@ For convenience, each migration operation will dispatch an [event](/docs/{{versi
| `Illuminate\Database\Events\MigrationsEnded` | A batch of migrations has finished executing. |
| `Illuminate\Database\Events\MigrationStarted` | A single migration is about to be executed. |
| `Illuminate\Database\Events\MigrationEnded` | A single migration has finished executing. |

2 changes: 1 addition & 1 deletion original-en/rate-limiting.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ If you would like to manually interact with the rate limiter, a variety of other

use Illuminate\Support\Facades\RateLimiter;

if (RateLimiter::tooManyAttempts('send-message:'.$user->id, $perMinute = 5) {
if (RateLimiter::tooManyAttempts('send-message:'.$user->id, $perMinute = 5)) {
return 'Too many attempts!';
}

Expand Down
8 changes: 6 additions & 2 deletions original-en/scout.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ When using the Algolia driver, you should configure your Algolia `id` and `secre
<a name="meilisearch"></a>
#### MeiliSearch

[MeiliSearch](https://www.meilisearch.com) is a blazingly fast and open source search engine. If you aren't sure how to install MeiliSearch on your local machine, you may use [Laravel Sail](/docs/{{version}}/sail#meilisearch), Laravel's officially supported Docker development environment.

When using the MeiliSearch driver you will need to install the MeiliSearch PHP SDK via the Composer package manager:

composer require meilisearch/meilisearch-php http-interop/http-factory-guzzle
Expand All @@ -80,9 +82,11 @@ Then, set the `SCOUT_DRIVER` environment variable as well as your MeiliSearch `h
MEILISEARCH_HOST=http://127.0.0.1:7700
MEILISEARCH_KEY=masterKey

For more information regarding MeiliSearch, please consult the [MeiliSearch documentation](https://docs.meilisearch.com/learn/getting_started/quick_start.html).
For more information regarding MeiliSearch, please consult the [MeiliSearch documentation](https://docs.meilisearch.com/learn/getting_started/quick_start.html).

In addition, you should ensure that you install a version of `meilisearch/meilisearch-php` that is compatible with your MeiliSearch binary version by reviewing [MeiliSearch's documentation regarding binary compatibility](https://github.com/meilisearch/meilisearch-php#-compatibility-with-meilisearch).

> {tip} If you aren't sure how to install MeiliSearch on your local machine, you may use [Laravel Sail](/docs/{{version}}/sail#meilisearch), Laravel's officially supported Docker development environment.
> {note} When upgrading Scout on an application that utilizes MeiliSearch, you should always [review any additional breaking changes](https://github.com/meilisearch/MeiliSearch/releases) to the MeiliSearch service itself.
<a name="queueing"></a>
### Queueing
Expand Down
44 changes: 44 additions & 0 deletions original-en/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ Below is a list of all available validation rules and their function:
[Distinct](#rule-distinct)
[Email](#rule-email)
[Ends With](#rule-ends-with)
[Exclude](#rule-exclude)
[Exclude If](#rule-exclude-if)
[Exclude Unless](#rule-exclude-unless)
[Exists (Database)](#rule-exists)
Expand Down Expand Up @@ -780,6 +781,7 @@ Below is a list of all available validation rules and their function:
[Prohibited](#rule-prohibited)
[Prohibited If](#rule-prohibited-if)
[Prohibited Unless](#rule-prohibited-unless)
[Prohibits](#rule-prohibits)
[Regular Expression](#rule-regex)
[Required](#rule-required)
[Required If](#rule-required-if)
Expand Down Expand Up @@ -1024,6 +1026,11 @@ The `filter` validator, which uses PHP's `filter_var` function, ships with Larav

The field under validation must end with one of the given values.

<a name="rule-exclude"></a>
#### exclude

The field under validation will be excluded from the request data returned by the `validate` and `validated` methods.

<a name="rule-exclude-if"></a>
#### exclude_if:_anotherfield_,_value_

Expand Down Expand Up @@ -1272,6 +1279,11 @@ The field under validation must be empty or not present if the _anotherfield_ fi

The field under validation must be empty or not present unless the _anotherfield_ field is equal to any _value_.

<a name="rule-prohibits"></a>
#### prohibits:_anotherfield_,...

If the field under validation is present, no fields in _anotherfield_ can be present, even if empty.

<a name="rule-regex"></a>
#### regex:_pattern_

Expand Down Expand Up @@ -1509,6 +1521,34 @@ The first argument passed to the `sometimes` method is the name of the field we

> {tip} The `$input` parameter passed to your closure will be an instance of `Illuminate\Support\Fluent` and may be used to access your input and files under validation.
<a name="complex-conditional-array-validation"></a>
#### Complex Conditional Array Validation

Sometimes you may want to validate a field based on another field in the same nested array whose index you do not know. In these situations, you may allow your closure to receive a second argument which will be the current individual item in the array being validated:

$input = [
'channels' => [
[
'type' => 'email',
'address' => '[email protected]',
],
[
'type' => 'url',
'address' => 'https://example.com',
],
],
];

$validator->sometimes('channels.*.address', 'email', function($input, $item) {
return $item->type === 'email';
});

$validator->sometimes('channels.*.address', 'url', function($input, $item) {
return $item->type !== 'email';
});

Like the `$input` parameter passed to the closure, the `$item` parameter is an instance of `Illuminate\Support\Fluent` when the attribute data is an array; otherwise, it is a string.

<a name="validating-arrays"></a>
## Validating Arrays

Expand Down Expand Up @@ -1750,4 +1790,8 @@ By default, when an attribute being validated is not present or contains an empt

For a custom rule to run even when an attribute is empty, the rule must imply that the attribute is required. To create an "implicit" rule, implement the `Illuminate\Contracts\Validation\ImplicitRule` interface. This interface serves as a "marker interface" for the validator; therefore, it does not contain any additional methods you need to implement beyond the methods required by the typical `Rule` interface.

To generate a new implicit rule object, you may use the `make:rule` Artisan command with the `--implicit` option :

php artisan make:rule Uppercase --implicit

> {note} An "implicit" rule only _implies_ that the attribute is required. Whether it actually invalidates a missing or empty attribute is up to you.
2 changes: 1 addition & 1 deletion translation-ja/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ PHPFastCGIとApacheを使用してLaravelアプリケーションを提供して
/**
* ユーザーをアプリケーションからログアウトさせる
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function logout(Request $request)
Expand Down
2 changes: 1 addition & 1 deletion translation-ja/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ Bladeテンプレートを作成するとき、ユーザーが特定のアクシ
@can('update', $post)
<!-- 現在のユーザーは投稿を更新可能 -->
@elsecan('create', App\Models\Post::class)
<!-- 現在のユーザーは新しい投稿を作成可能 -->
<!-- 現在のユーザーは新しい投稿を作成不可能 -->
@else
<!-- ... -->
@endcan
Expand Down
2 changes: 2 additions & 0 deletions translation-ja/billing.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ Cashierでは、顧客のタックスIDを簡単に管理できます。例え

これを自動化するには、Billableモデルにイベントリスナを定義して、モデルの`updated`イベントに対応させます。そして、イベントリスナの中で、モデルの`syncStripeCustomerDetails`メソッドを呼び出します。

use function Illuminate\Events\queueable;

/**
* The "booted" method of the model.
*
Expand Down
8 changes: 8 additions & 0 deletions translation-ja/eloquent-mutators.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [属性のキャスト](#attribute-casting)
- [配列とJSONのキャスト](#array-and-json-casting)
- [日付のキャスト](#date-casting)
- [暗号化キャスト](#encrypted-casting)
- [クエリ時のキャスト](#query-time-casting)
- [カスタムキャスト](#custom-casts)
- [値オブジェクトのキャスト](#value-object-casting)
Expand Down Expand Up @@ -300,6 +301,13 @@ JSON属性の単一のフィールドをより簡潔な構文で更新するに

`datetime:Y-m-d H:i:s`のようなカスタムフォーマットを`date``datetime`キャストで適用する場合は、日付のシリアライズの際に、Carbonインスタンスの内部タイムゾーンが使用されます。一般的には、アプリケーションの`timezone`設定オプションで指定したタイムゾーンを使用します。

<a name="encrypted-casting"></a>
### 暗号化キャスト

`encrypted`キャストは、Laravelに組み込まれた[暗号化](/docs/{{version}}/encryption)機能を使って、モデルの属性値を暗号化します。さらに、`encrypted:array``encrypted:collection``encrypted:object`のキャストは、暗号化されていないものと同様の動作をしますが、ご期待通りにデータベースに保存される際に、基本的な値を暗号化します。

暗号化したテキストの最終的な長さは予測できず、プレーンテキストのものよりも長くなるので、関連するデータベースのカラムが `TEXT` 型以上であることを確認してください。さらに、値はデータベース内で暗号化されているので、暗号化された属性値を問い合わせたり検索したりすることはできません。

<a name="query-time-casting"></a>
### クエリ時のキャスト

Expand Down
Loading

0 comments on commit 57bb770

Please sign in to comment.