Skip to content

Commit 402cf10

Browse files
committed
2023/11/13までの原文変更点反映。
1 parent d99b603 commit 402cf10

File tree

12 files changed

+249
-43
lines changed

12 files changed

+249
-43
lines changed

original-en/artisan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ If you would like complete control over the prompt, you may provide a closure th
443443
label: 'Search for a user:',
444444
placeholder: 'E.g. Taylor Otwell',
445445
options: fn ($value) => strlen($value) > 0
446-
? User::where('name', 'like', "%{$value}%")->pluck('name', 'id')
446+
? User::where('name', 'like', "%{$value}%")->pluck('name', 'id')->all()
447447
: []
448448
),
449449
];

original-en/eloquent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ If you would like a model to use a UUID key instead of an auto-incrementing inte
221221

222222
$article->id; // "8f8e8478-9035-4d23-b9a7-62f4d2612ce5"
223223

224-
By default, The `HasUuids` trait will generate ["ordered" UUIDs](/docs/{{version}}/helpers#method-str-ordered-uuid) for your models. These UUIDs are more efficient for indexed database storage because they can be sorted lexicographically.
224+
By default, The `HasUuids` trait will generate ["ordered" UUIDs](/docs/{{version}}/strings#method-str-ordered-uuid) for your models. These UUIDs are more efficient for indexed database storage because they can be sorted lexicographically.
225225

226226
You can override the UUID generation process for a given model by defining a `newUniqueId` method on the model. In addition, you may specify which columns should receive UUIDs by defining a `uniqueIds` method on the model:
227227

original-en/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Typically, events should be registered via the `EventServiceProvider` `$listen`
8282
{
8383
Event::listen(
8484
PodcastProcessed::class,
85-
[SendPodcastNotification::class, 'handle']
85+
SendPodcastNotification::class,
8686
);
8787

8888
Event::listen(function (PodcastProcessed $event) {

original-en/installation.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,7 @@ Your `.env` file should not be committed to your application's source control, s
230230

231231
Now that you have created your Laravel application, you probably want to store some data in a database. By default, your application's `.env` configuration file specifies that Laravel will be interacting with a MySQL database and will access the database at `127.0.0.1`. If you are developing on macOS and need to install MySQL, Postgres, or Redis locally, you may find it convenient to utilize [DBngin](https://dbngin.com/).
232232

233-
If you do not want to install MySQL or Postgres on your local machine, you can always use a [SQLite](https://www.sqlite.org/index.html) database. SQLite is a small, fast, self-contained database engine. To get started, create a SQLite database by creating an empty SQLite file. Typically, this file will exist within the `database` directory of your Laravel application:
234-
235-
```shell
236-
touch database/database.sqlite
237-
```
238-
239-
Next, update your `.env` configuration file to use Laravel's `sqlite` database driver. You may remove the other database configuration options:
233+
If you do not want to install MySQL or Postgres on your local machine, you can always use a [SQLite](https://www.sqlite.org/index.html) database. SQLite is a small, fast, self-contained database engine. To get started, update your `.env` configuration file to use Laravel's `sqlite` database driver. You may remove the other database configuration options:
240234

241235
```ini
242236
DB_CONNECTION=sqlite # [tl! add]
@@ -254,6 +248,8 @@ Once you have configured your SQLite database, you may run your application's [d
254248
php artisan migrate
255249
```
256250

251+
If an SQLite database does not exist for your application, Laravel will ask you if you would like the database to be created. Typically, the SQLite database file will be created at `database/database.sqlite`.
252+
257253
<a name="directory-configuration"></a>
258254
### Directory Configuration
259255

original-en/logging.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
- [Customizing Monolog For Channels](#customizing-monolog-for-channels)
1414
- [Creating Monolog Handler Channels](#creating-monolog-handler-channels)
1515
- [Creating Custom Channels Via Factories](#creating-custom-channels-via-factories)
16+
- [Tailing Log Messages Using Pail](#tailing-log-messages-using-pail)
17+
- [Installation](#pail-installation)
18+
- [Usage](#pail-usage)
19+
- [Filtering Logs](#pail-filtering-logs)
1620

1721
<a name="introduction"></a>
1822
## Introduction
@@ -444,3 +448,86 @@ Once you have configured the `custom` driver channel, you're ready to define the
444448
return new Logger(/* ... */);
445449
}
446450
}
451+
452+
<a name="tailing-log-messages-using-pail"></a>
453+
## Tailing Log Messages Using Pail
454+
455+
Often you may need to tail your application's logs in real time. For example, when debugging an issue or when monitoring your application's logs for specific types of errors.
456+
457+
Laravel Pail is a package that allows you to easily dive into your Laravel application's log files directly from the command line. Unlike the standard `tail` command, Pail is designed to work with any log driver, including Sentry or Flare. In addition, Pail provides a set of useful filters to help you quickly find what you're looking for.
458+
459+
<img src="https://laravel.com/img/docs/pail-example.png">
460+
461+
<a name="pail-installation"></a>
462+
### Installation
463+
464+
> **Warning**
465+
> Laravel Pail requires [PHP 8.2+](https://php.net/releases/) and the [PCNTL](https://www.php.net/manual/en/book.pcntl.php) extension.
466+
467+
To get started, install Pail into your project using the Composer package manager:
468+
469+
```bash
470+
composer require laravel/pail
471+
```
472+
473+
<a name="pail-usage"></a>
474+
### Usage
475+
476+
To start tailing logs, run the `pail` command:
477+
478+
```bash
479+
php artisan pail
480+
```
481+
482+
To increase the verbosity of the output and avoid truncation (…), use the `-v` option:
483+
484+
```bash
485+
php artisan pail -v
486+
```
487+
488+
For maximum verbosity and to display exception stack traces, use the `-vv` option:
489+
490+
```bash
491+
php artisan pail -vv
492+
```
493+
494+
To stop tailing logs, press `Ctrl+C` at any time.
495+
496+
<a name="pail-filtering-logs"></a>
497+
### Filtering Logs
498+
499+
<a name="pail-filtering-logs-filter-option"></a>
500+
#### `--filter`
501+
502+
You may use the `--filter` option to filter logs by their type, file, message, and stack trace content:
503+
504+
```bash
505+
php artisan pail --filter="QueryException"
506+
```
507+
508+
<a name="pail-filtering-logs-message-option"></a>
509+
#### `--message`
510+
511+
To filter logs by only their message, you may use the `--message` option:
512+
513+
```bash
514+
php artisan pail --message="User created"
515+
```
516+
517+
<a name="pail-filtering-logs-level-option"></a>
518+
#### `--level`
519+
520+
The `--level` option may be used to filter logs by their [log level](#log-levels):
521+
522+
```bash
523+
php artisan pail --level=error
524+
```
525+
526+
<a name="pail-filtering-logs-user-option"></a>
527+
#### `--user`
528+
529+
To only display logs that were written while a given user was authenticated, you may provide the user's ID to the `--user` option:
530+
531+
```bash
532+
php artisan pail --user=1
533+
```

original-en/queues.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- [Job Batching](#job-batching)
2424
- [Defining Batchable Jobs](#defining-batchable-jobs)
2525
- [Dispatching Batches](#dispatching-batches)
26+
- [Chains & Batches](#chains-and-batches)
2627
- [Adding Jobs To Batches](#adding-jobs-to-batches)
2728
- [Inspecting Batches](#inspecting-batches)
2829
- [Cancelling Batches](#cancelling-batches)
@@ -1288,8 +1289,8 @@ If you would like to specify the connection and queue that should be used for th
12881289
// All jobs completed successfully...
12891290
})->onConnection('redis')->onQueue('imports')->dispatch();
12901291

1291-
<a name="chains-within-batches"></a>
1292-
#### Chains Within Batches
1292+
<a name="chains-and-batches"></a>
1293+
### Chains & Batches
12931294

12941295
You may define a set of [chained jobs](#job-chaining) within a batch by placing the chained jobs within an array. For example, we may execute two job chains in parallel and execute a callback when both job chains have finished processing:
12951296

@@ -1311,6 +1312,25 @@ You may define a set of [chained jobs](#job-chaining) within a batch by placing
13111312
// ...
13121313
})->dispatch();
13131314

1315+
Conversely, you may run batches of jobs within a [chain](#job-chaining) by defining batches within the chain. For example, you could first run a batch of jobs to release multiple podcasts then a batch of jobs to send the release notifications:
1316+
1317+
use App\Jobs\FlushPodcastCache;
1318+
use App\Jobs\ReleasePodcast;
1319+
use App\Jobs\SendPodcastReleaseNotification;
1320+
use Illuminate\Support\Facades\Bus;
1321+
1322+
Bus::chain([
1323+
new FlushPodcastCache,
1324+
Bus::batch([
1325+
new ReleasePodcast(1),
1326+
new ReleasePodcast(2),
1327+
]),
1328+
Bus::batch([
1329+
new SendPodcastReleaseNotification(1),
1330+
new SendPodcastReleaseNotification(2),
1331+
]),
1332+
])->dispatch();
1333+
13141334
<a name="adding-jobs-to-batches"></a>
13151335
### Adding Jobs To Batches
13161336

translation-ja/artisan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ Laravelが必要な引数をユーザーから収集する必要がある場合
443443
label: 'Search for a user:',
444444
placeholder: 'E.g. Taylor Otwell',
445445
options: fn ($value) => strlen($value) > 0
446-
? User::where('name', 'like', "%{$value}%")->pluck('name', 'id')
446+
? User::where('name', 'like', "%{$value}%")->pluck('name', 'id')->all()
447447
: []
448448
),
449449
];

translation-ja/eloquent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Eloquentモデルの主キーへ、自動増分整数を使用する代わりに
221221

222222
$article->id; // "8f8e8478-9035-4d23-b9a7-62f4d2612ce5"
223223

224-
`HasUuids`トレイトはデフォルトで、モデルに対し[順序付き(ordered)UUID](/docs/{{version}}/helpers#method-str-ordered-uuid)を生成します。これらのUUIDは辞書式にソートすることができるため、インデックス付きデータベースの保存が効率的です。
224+
`HasUuids`トレイトはデフォルトで、モデルに対し[順序付き(ordered)UUID](/docs/{{version}}/strings#method-str-ordered-uuid)を生成します。これらのUUIDは辞書式にソートすることができるため、インデックス付きデータベースの保存が効率的です。
225225

226226
モデルへ`newUniqueId`メソッドを定義すれば、指定モデルのUUID生成処理をオーバーライドできます。さらに、モデルに`uniqueIds`メソッドを定義すれば、UUIDをどのカラムで受け取るのかを指定できます。
227227

translation-ja/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ php artisan make:listener SendPodcastNotification --event=PodcastProcessed
8282
{
8383
Event::listen(
8484
PodcastProcessed::class,
85-
[SendPodcastNotification::class, 'handle']
85+
SendPodcastNotification::class,
8686
);
8787

8888
Event::listen(function (PodcastProcessed $event) {

translation-ja/installation.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,7 @@ Laravelの設定オプションの値の多くは、アプリケーションが
230230

231231
Laravelアプリケーションを作成したら、データをデータベースへ保存したいと思うことでしょう。アプリケーションの`.env`設定ファイルはデフォルトで、MySQLデータベースを操作するように指定し、`127.0.0.1`のデータベースへアクセスするようになっています。macOSで開発しており、MySQL、Postgres、Redisをローカルにインストールする必要がある場合、[DBngin](https://dbngin.com/)を利用すると便利です。
232232

233-
ローカルマシンにMySQLやPostgresをインストールしたくない場合は、いつでも[SQLite](https://www.sqlite.org/index.html)データベースを使用できます。SQLiteは小さく、高速で、自己完結型のデータベースエンジンです。使用し始めるには、空のSQLiteファイルを作成することにより、SQLiteデータベースを作成します。通常、このファイルはLaravelアプリケーションの`database`ディレクトリの中に設置します。
234-
235-
```shell
236-
touch database/database.sqlite
237-
```
238-
239-
次に、Laravelが`sqlite`データベースドライバを使用するよう、`.env`設定ファイルを変更します。他のデータベース設定オプションは削除してかまいません。
233+
ローカルマシンにMySQLやPostgresをインストールしたくない場合は、いつでも[SQLite](https://www.sqlite.org/index.html)データベースを使うことができます。SQLiteは小さく、高速で、自己完結型のデータベースエンジンです。使い始めるには、Laravelの`sqlite`データベースドライバを使用するように、`.env`設定ファイルを更新してください。他のデータベース設定オプションは削除してもかまいません:
240234

241235
```ini
242236
DB_CONNECTION=sqlite # [tl! add]
@@ -254,6 +248,8 @@ SQLiteデータベースの設定が終わったら、[データベースマイ
254248
php artisan migrate
255249
```
256250

251+
アプリケーションにSQLiteデータベースが存在しない場合、Laravelはデータベースを作成するかを尋ねます。通常、SQLiteデータベースファイルは、`database/database.sqlite`へ作成します。
252+
257253
<a name="directory-configuration"></a>
258254
### ディレクトリ設定
259255

0 commit comments

Comments
 (0)