diff --git a/original-en/artisan.md b/original-en/artisan.md
index 88ebf35..08925d1 100644
--- a/original-en/artisan.md
+++ b/original-en/artisan.md
@@ -443,7 +443,7 @@ If you would like complete control over the prompt, you may provide a closure th
label: 'Search for a user:',
placeholder: 'E.g. Taylor Otwell',
options: fn ($value) => strlen($value) > 0
- ? User::where('name', 'like', "%{$value}%")->pluck('name', 'id')
+ ? User::where('name', 'like', "%{$value}%")->pluck('name', 'id')->all()
: []
),
];
diff --git a/original-en/eloquent.md b/original-en/eloquent.md
index 69ff845..2cd1e10 100644
--- a/original-en/eloquent.md
+++ b/original-en/eloquent.md
@@ -221,7 +221,7 @@ If you would like a model to use a UUID key instead of an auto-incrementing inte
$article->id; // "8f8e8478-9035-4d23-b9a7-62f4d2612ce5"
-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.
+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.
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:
diff --git a/original-en/events.md b/original-en/events.md
index 455a973..9e477a4 100644
--- a/original-en/events.md
+++ b/original-en/events.md
@@ -82,7 +82,7 @@ Typically, events should be registered via the `EventServiceProvider` `$listen`
{
Event::listen(
PodcastProcessed::class,
- [SendPodcastNotification::class, 'handle']
+ SendPodcastNotification::class,
);
Event::listen(function (PodcastProcessed $event) {
diff --git a/original-en/installation.md b/original-en/installation.md
index 3c964c1..037792a 100644
--- a/original-en/installation.md
+++ b/original-en/installation.md
@@ -230,13 +230,7 @@ Your `.env` file should not be committed to your application's source control, s
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/).
-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:
-
-```shell
-touch database/database.sqlite
-```
-
-Next, update your `.env` configuration file to use Laravel's `sqlite` database driver. You may remove the other database configuration options:
+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:
```ini
DB_CONNECTION=sqlite # [tl! add]
@@ -254,6 +248,8 @@ Once you have configured your SQLite database, you may run your application's [d
php artisan migrate
```
+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`.
+
### Directory Configuration
diff --git a/original-en/logging.md b/original-en/logging.md
index f91773b..e1bb66b 100644
--- a/original-en/logging.md
+++ b/original-en/logging.md
@@ -13,6 +13,10 @@
- [Customizing Monolog For Channels](#customizing-monolog-for-channels)
- [Creating Monolog Handler Channels](#creating-monolog-handler-channels)
- [Creating Custom Channels Via Factories](#creating-custom-channels-via-factories)
+- [Tailing Log Messages Using Pail](#tailing-log-messages-using-pail)
+ - [Installation](#pail-installation)
+ - [Usage](#pail-usage)
+ - [Filtering Logs](#pail-filtering-logs)
## Introduction
@@ -444,3 +448,86 @@ Once you have configured the `custom` driver channel, you're ready to define the
return new Logger(/* ... */);
}
}
+
+
+## Tailing Log Messages Using Pail
+
+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.
+
+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.
+
+
+
+
+### Installation
+
+> **Warning**
+> Laravel Pail requires [PHP 8.2+](https://php.net/releases/) and the [PCNTL](https://www.php.net/manual/en/book.pcntl.php) extension.
+
+To get started, install Pail into your project using the Composer package manager:
+
+```bash
+composer require laravel/pail
+```
+
+
+### Usage
+
+To start tailing logs, run the `pail` command:
+
+```bash
+php artisan pail
+```
+
+To increase the verbosity of the output and avoid truncation (…), use the `-v` option:
+
+```bash
+php artisan pail -v
+```
+
+For maximum verbosity and to display exception stack traces, use the `-vv` option:
+
+```bash
+php artisan pail -vv
+```
+
+To stop tailing logs, press `Ctrl+C` at any time.
+
+
+### Filtering Logs
+
+
+#### `--filter`
+
+You may use the `--filter` option to filter logs by their type, file, message, and stack trace content:
+
+```bash
+php artisan pail --filter="QueryException"
+```
+
+
+#### `--message`
+
+To filter logs by only their message, you may use the `--message` option:
+
+```bash
+php artisan pail --message="User created"
+```
+
+
+#### `--level`
+
+The `--level` option may be used to filter logs by their [log level](#log-levels):
+
+```bash
+php artisan pail --level=error
+```
+
+
+#### `--user`
+
+To only display logs that were written while a given user was authenticated, you may provide the user's ID to the `--user` option:
+
+```bash
+php artisan pail --user=1
+```
diff --git a/original-en/queues.md b/original-en/queues.md
index 566c545..bc86499 100644
--- a/original-en/queues.md
+++ b/original-en/queues.md
@@ -23,6 +23,7 @@
- [Job Batching](#job-batching)
- [Defining Batchable Jobs](#defining-batchable-jobs)
- [Dispatching Batches](#dispatching-batches)
+ - [Chains & Batches](#chains-and-batches)
- [Adding Jobs To Batches](#adding-jobs-to-batches)
- [Inspecting Batches](#inspecting-batches)
- [Cancelling Batches](#cancelling-batches)
@@ -1288,8 +1289,8 @@ If you would like to specify the connection and queue that should be used for th
// All jobs completed successfully...
})->onConnection('redis')->onQueue('imports')->dispatch();
-
-#### Chains Within Batches
+
+### Chains & Batches
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:
@@ -1311,6 +1312,25 @@ You may define a set of [chained jobs](#job-chaining) within a batch by placing
// ...
})->dispatch();
+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:
+
+ use App\Jobs\FlushPodcastCache;
+ use App\Jobs\ReleasePodcast;
+ use App\Jobs\SendPodcastReleaseNotification;
+ use Illuminate\Support\Facades\Bus;
+
+ Bus::chain([
+ new FlushPodcastCache,
+ Bus::batch([
+ new ReleasePodcast(1),
+ new ReleasePodcast(2),
+ ]),
+ Bus::batch([
+ new SendPodcastReleaseNotification(1),
+ new SendPodcastReleaseNotification(2),
+ ]),
+ ])->dispatch();
+
### Adding Jobs To Batches
diff --git a/translation-ja/artisan.md b/translation-ja/artisan.md
index 73e1e4b..faeae30 100644
--- a/translation-ja/artisan.md
+++ b/translation-ja/artisan.md
@@ -443,7 +443,7 @@ Laravelが必要な引数をユーザーから収集する必要がある場合
label: 'Search for a user:',
placeholder: 'E.g. Taylor Otwell',
options: fn ($value) => strlen($value) > 0
- ? User::where('name', 'like', "%{$value}%")->pluck('name', 'id')
+ ? User::where('name', 'like', "%{$value}%")->pluck('name', 'id')->all()
: []
),
];
diff --git a/translation-ja/eloquent.md b/translation-ja/eloquent.md
index 3c9918a..a73e610 100644
--- a/translation-ja/eloquent.md
+++ b/translation-ja/eloquent.md
@@ -221,7 +221,7 @@ Eloquentモデルの主キーへ、自動増分整数を使用する代わりに
$article->id; // "8f8e8478-9035-4d23-b9a7-62f4d2612ce5"
-`HasUuids`トレイトはデフォルトで、モデルに対し[順序付き(ordered)UUID](/docs/{{version}}/helpers#method-str-ordered-uuid)を生成します。これらのUUIDは辞書式にソートすることができるため、インデックス付きデータベースの保存が効率的です。
+`HasUuids`トレイトはデフォルトで、モデルに対し[順序付き(ordered)UUID](/docs/{{version}}/strings#method-str-ordered-uuid)を生成します。これらのUUIDは辞書式にソートすることができるため、インデックス付きデータベースの保存が効率的です。
モデルへ`newUniqueId`メソッドを定義すれば、指定モデルのUUID生成処理をオーバーライドできます。さらに、モデルに`uniqueIds`メソッドを定義すれば、UUIDをどのカラムで受け取るのかを指定できます。
diff --git a/translation-ja/events.md b/translation-ja/events.md
index 9f14a63..0876a8d 100644
--- a/translation-ja/events.md
+++ b/translation-ja/events.md
@@ -82,7 +82,7 @@ php artisan make:listener SendPodcastNotification --event=PodcastProcessed
{
Event::listen(
PodcastProcessed::class,
- [SendPodcastNotification::class, 'handle']
+ SendPodcastNotification::class,
);
Event::listen(function (PodcastProcessed $event) {
diff --git a/translation-ja/installation.md b/translation-ja/installation.md
index 9780734..b4ec6e1 100644
--- a/translation-ja/installation.md
+++ b/translation-ja/installation.md
@@ -230,13 +230,7 @@ Laravelの設定オプションの値の多くは、アプリケーションが
Laravelアプリケーションを作成したら、データをデータベースへ保存したいと思うことでしょう。アプリケーションの`.env`設定ファイルはデフォルトで、MySQLデータベースを操作するように指定し、`127.0.0.1`のデータベースへアクセスするようになっています。macOSで開発しており、MySQL、Postgres、Redisをローカルにインストールする必要がある場合、[DBngin](https://dbngin.com/)を利用すると便利です。
-ローカルマシンにMySQLやPostgresをインストールしたくない場合は、いつでも[SQLite](https://www.sqlite.org/index.html)データベースを使用できます。SQLiteは小さく、高速で、自己完結型のデータベースエンジンです。使用し始めるには、空のSQLiteファイルを作成することにより、SQLiteデータベースを作成します。通常、このファイルはLaravelアプリケーションの`database`ディレクトリの中に設置します。
-
-```shell
-touch database/database.sqlite
-```
-
-次に、Laravelが`sqlite`データベースドライバを使用するよう、`.env`設定ファイルを変更します。他のデータベース設定オプションは削除してかまいません。
+ローカルマシンにMySQLやPostgresをインストールしたくない場合は、いつでも[SQLite](https://www.sqlite.org/index.html)データベースを使うことができます。SQLiteは小さく、高速で、自己完結型のデータベースエンジンです。使い始めるには、Laravelの`sqlite`データベースドライバを使用するように、`.env`設定ファイルを更新してください。他のデータベース設定オプションは削除してもかまいません:
```ini
DB_CONNECTION=sqlite # [tl! add]
@@ -254,6 +248,8 @@ SQLiteデータベースの設定が終わったら、[データベースマイ
php artisan migrate
```
+アプリケーションにSQLiteデータベースが存在しない場合、Laravelはデータベースを作成するかを尋ねます。通常、SQLiteデータベースファイルは、`database/database.sqlite`へ作成します。
+
### ディレクトリ設定
diff --git a/translation-ja/logging.md b/translation-ja/logging.md
index 39ede69..e93b4b1 100644
--- a/translation-ja/logging.md
+++ b/translation-ja/logging.md
@@ -13,6 +13,10 @@
- [チャンネル向けMonologカスタマイズ](#customizing-monolog-for-channels)
- [Monolog処理チャンネルの作成](#creating-monolog-handler-channels)
- [ファクトリによるカスタムチャンネルの生成](#creating-custom-channels-via-factories)
+- [Failを使用したログの限定出力](#tailing-log-messages-using-pail)
+ - [インストール](#pail-installation)
+ - [使用法](#pail-usage)
+ - [ログのフィルタリング](#pail-filtering-logs)
## イントロダクション
@@ -48,17 +52,17 @@ Laravelはメッセージをログに記録するときに、デフォルトで`