From bd9c8854c04810095a4a3236e893b494feec0b40 Mon Sep 17 00:00:00 2001 From: Hirohisa Kawase Date: Mon, 23 Oct 2023 05:43:45 +0900 Subject: [PATCH] =?UTF-8?q?2023-10-23=E3=81=BE=E3=81=A7=E3=81=AE=E5=8E=9F?= =?UTF-8?q?=E6=96=87=E5=A4=89=E6=9B=B4=E7=82=B9=E5=8F=8D=E6=98=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- original-en/collections.md | 4 ++-- original-en/container.md | 2 +- original-en/dusk.md | 2 +- original-en/eloquent-relationships.md | 2 +- original-en/events.md | 8 ++++---- original-en/homestead.md | 18 ++++++++++++++---- original-en/processes.md | 2 +- translation-ja/collections.md | 4 ++-- translation-ja/container.md | 2 +- translation-ja/dusk.md | 2 +- translation-ja/eloquent-relationships.md | 2 +- translation-ja/events.md | 8 ++++---- translation-ja/homestead.md | 18 ++++++++++++++---- 13 files changed, 47 insertions(+), 27 deletions(-) diff --git a/original-en/collections.md b/original-en/collections.md index 370ebb4..05c72c1 100644 --- a/original-en/collections.md +++ b/original-en/collections.md @@ -366,7 +366,7 @@ The `collect` method is primarily useful for converting [lazy collections](#lazy $collection = $lazyCollection->collect(); - get_class($collection); + $collection::class; // 'Illuminate\Support\Collection' @@ -1367,7 +1367,7 @@ The `lazy` method returns a new [`LazyCollection`](#lazy-collections) instance f $lazyCollection = collect([1, 2, 3, 4])->lazy(); - get_class($lazyCollection); + $lazyCollection::class; // Illuminate\Support\LazyCollection diff --git a/original-en/container.md b/original-en/container.md index a42854d..5c546ac 100644 --- a/original-en/container.md +++ b/original-en/container.md @@ -71,7 +71,7 @@ If a class has no dependencies or only depends on other concrete classes (not in } Route::get('/', function (Service $service) { - die(get_class($service)); + die($service::class); }); In this example, hitting your application's `/` route will automatically resolve the `Service` class and inject it into your route's handler. This is game changing. It means you can develop your application and take advantage of dependency injection without worrying about bloated configuration files. diff --git a/original-en/dusk.md b/original-en/dusk.md index 994b742..0dfb2a2 100644 --- a/original-en/dusk.md +++ b/original-en/dusk.md @@ -2058,7 +2058,7 @@ jobs: DB_PASSWORD: root MAIL_MAILER: log steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Prepare The Environment run: cp .env.example .env - name: Create Database diff --git a/original-en/eloquent-relationships.md b/original-en/eloquent-relationships.md index 6514a9d..f3a4fde 100644 --- a/original-en/eloquent-relationships.md +++ b/original-en/eloquent-relationships.md @@ -1856,7 +1856,7 @@ You may customize the behavior of lazy loading violations using the `handleLazyL ```php Model::handleLazyLoadingViolationUsing(function (Model $model, string $relation) { - $class = get_class($model); + $class = $model::class; info("Attempted to lazy load [{$relation}] on model [{$class}]."); }); diff --git a/original-en/events.md b/original-en/events.md index d18f83e..00a9c6f 100644 --- a/original-en/events.md +++ b/original-en/events.md @@ -553,12 +553,12 @@ Event subscribers are classes that may subscribe to multiple events from within /** * Handle user login events. */ - public function handleUserLogin(string $event): void {} + public function handleUserLogin(Login $event): void {} /** * Handle user logout events. */ - public function handleUserLogout(string $event): void {} + public function handleUserLogout(Logout $event): void {} /** * Register the listeners for the subscriber. @@ -592,12 +592,12 @@ If your event listener methods are defined within the subscriber itself, you may /** * Handle user login events. */ - public function handleUserLogin(string $event): void {} + public function handleUserLogin(Login $event): void {} /** * Handle user logout events. */ - public function handleUserLogout(string $event): void {} + public function handleUserLogout(Logout $event): void {} /** * Register the listeners for the subscriber. diff --git a/original-en/homestead.md b/original-en/homestead.md index 03cf1bb..444a94f 100644 --- a/original-en/homestead.md +++ b/original-en/homestead.md @@ -217,7 +217,7 @@ folders: > **Warning** > You should never mount `.` (the current directory) when using Homestead. This causes Vagrant to not map the current folder to `/vagrant` and will break optional features and cause unexpected results while provisioning. -To enable [NFS](https://www.vagrantup.com/docs/synced-folders/nfs.html), you may add a `type` option to your folder mapping: +To enable [NFS](https://developer.hashicorp.com/vagrant/docs/synced-folders/nfs), you may add a `type` option to your folder mapping: ```yaml folders: @@ -229,7 +229,7 @@ folders: > **Warning** > When using NFS on Windows, you should consider installing the [vagrant-winnfsd](https://github.com/winnfsd/vagrant-winnfsd) plug-in. This plug-in will maintain the correct user / group permissions for files and directories within the Homestead virtual machine. -You may also pass any options supported by Vagrant's [Synced Folders](https://www.vagrantup.com/docs/synced-folders/basic_usage.html) by listing them under the `options` key: +You may also pass any options supported by Vagrant's [Synced Folders](https://developer.hashicorp.com/vagrant/docs/synced-folders/basic_usage) by listing them under the `options` key: ```yaml folders: @@ -784,7 +784,7 @@ networks: ip: "192.168.10.20" ``` -To enable a [bridged](https://www.vagrantup.com/docs/networking/public_network.html) interface, configure a `bridge` setting for the network and change the network type to `public_network`: +To enable a [bridged](https://developer.hashicorp.com/vagrant/docs/networking/public_network) interface, configure a `bridge` setting for the network and change the network type to `public_network`: ```yaml networks: @@ -793,7 +793,7 @@ networks: bridge: "en1: Wi-Fi (AirPort)" ``` -To enable [DHCP](https://www.vagrantup.com/docs/networking/public_network.html), just remove the `ip` option from your configuration: +To enable [DHCP](https://developer.hashicorp.com/vagrant/docs/networking/public_network#dhcp), just remove the `ip` option from your configuration: ```yaml networks: @@ -801,6 +801,16 @@ networks: bridge: "en1: Wi-Fi (AirPort)" ``` +To update what device the network is using, you may add a `dev` option to the network's configuration. The default `dev` value is `eth0`: + +```yaml +networks: + - type: "public_network" + ip: "192.168.10.20" + bridge: "en1: Wi-Fi (AirPort)" + dev: "enp2s0" +``` + ## Extending Homestead diff --git a/original-en/processes.md b/original-en/processes.md index 53ba46f..6fcd578 100644 --- a/original-en/processes.md +++ b/original-en/processes.md @@ -392,7 +392,7 @@ Route::get('/import', function () { }); ``` -When testing this route, we can instruct Laravel to return a fake, successful process result for every invoked process by calling the `fake` method on the `Process` facade with no arguments. In addition, we can even [assert](#available-assertions) that a given process was "ran": +When testing this route, we can instruct Laravel to return a fake, successful process result for every invoked process by calling the `fake` method on the `Process` facade with no arguments. In addition, we can even [assert](#available-assertions) that a given process was "run": ```php collect(); - get_class($collection); + $collection::class; // 'Illuminate\Support\Collection' @@ -1367,7 +1367,7 @@ $lazyCollection = collect([1, 2, 3, 4])->lazy(); - get_class($lazyCollection); + $lazyCollection::class; // Illuminate\Support\LazyCollection diff --git a/translation-ja/container.md b/translation-ja/container.md index 85dd48e..2824468 100644 --- a/translation-ja/container.md +++ b/translation-ja/container.md @@ -71,7 +71,7 @@ Laravelサービスコンテナを深く理解することは、強力で大規 } Route::get('/', function (Service $service) { - die(get_class($service)); + die($service::class); }); この例でアプリケーションの`/`ルートを訪問すれば、自動的に`Service`クラスが依存解決され、ルートのハンドラに依存挿入されます。これは大転換です。これは、アプリケーションの開発において、肥大化する設定ファイルの心配をせず依存注入を利用できることを意味します。 diff --git a/translation-ja/dusk.md b/translation-ja/dusk.md index 96fd292..12997de 100644 --- a/translation-ja/dusk.md +++ b/translation-ja/dusk.md @@ -2058,7 +2058,7 @@ jobs: DB_PASSWORD: root MAIL_MAILER: log steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Prepare The Environment run: cp .env.example .env - name: Create Database diff --git a/translation-ja/eloquent-relationships.md b/translation-ja/eloquent-relationships.md index 86d11dc..89e3edf 100644 --- a/translation-ja/eloquent-relationships.md +++ b/translation-ja/eloquent-relationships.md @@ -1856,7 +1856,7 @@ public function boot(): void ```php Model::handleLazyLoadingViolationUsing(function (Model $model, string $relation) { - $class = get_class($model); + $class = $model::class; info("Attempted to lazy load [{$relation}] on model [{$class}]."); }); diff --git a/translation-ja/events.md b/translation-ja/events.md index 90e4bab..5cc4b73 100644 --- a/translation-ja/events.md +++ b/translation-ja/events.md @@ -553,12 +553,12 @@ Laravelは、PHPのリフレクションサービスを使用してリスナク /** * ユーザーログインイベントの処理 */ - public function handleUserLogin(string $event): void {} + public function handleUserLogin(Login $event): void {} /** * ユーザーログアウトイベントの処理 */ - public function handleUserLogout(string $event): void {} + public function handleUserLogout(Logout $event): void {} /** * サブスクライバのリスナを登録 @@ -592,12 +592,12 @@ Laravelは、PHPのリフレクションサービスを使用してリスナク /** * ユーザーログインイベントの処理 */ - public function handleUserLogin(string $event): void {} + public function handleUserLogin(Login $event): void {} /** * ユーザーログアウトイベントの処理 */ - public function handleUserLogout(string $event): void {} + public function handleUserLogout(Logout $event): void {} /** * サブスクライバのリスナを登録 diff --git a/translation-ja/homestead.md b/translation-ja/homestead.md index f1f199a..69bcba8 100644 --- a/translation-ja/homestead.md +++ b/translation-ja/homestead.md @@ -217,7 +217,7 @@ folders: > **Warning** > Homesteadを使用する場合、`.`(カレントディレクトリ)をマウントしないでください。そうすると、Vagrantはカレントフォルダを`/vagrant`へマップしない状況が起き、オプションの機能が壊れ、プロビジョン中に予期せぬ結果が起きます。 -[NFS](https://www.vagrantup.com/v2/synced-folders/nfs.html)を有効にするには、フォルダのマッピングで`type`オプションを付けます。 +[NFS](https://developer.hashicorp.com/vagrant/docs/synced-folders/nfs)を有効にするには、フォルダのマッピングで`type`オプションを付けます。 ```yaml folders: @@ -229,7 +229,7 @@ folders: > **Warning** > Windows上でNFSを使用する場合は、[vagrant-winnfsd](https://github.com/winnfsd/vagrant-winnfsd)プラグインのインストールを考慮すべきでしょう。このプラグインは、Homestead仮想マシン下のファイルとディレクトリのユーザー/グループパーミッションを正しく維持します。 -さらに、Vagrantの[同期フォルダ](https://www.vagrantup.com/docs/synced-folders/basic_usage.html)でサポートされている任意のオプションを、`options`キーの下に列挙して渡すことができます。 +さらに、Vagrantの[同期フォルダ](https://developer.hashicorp.com/vagrant/docs/synced-folders/basic_usage)でサポートされている任意のオプションを、`options`キーの下に列挙して渡すことができます。 ```yaml folders: @@ -784,7 +784,7 @@ networks: ip: "192.168.10.20" ``` -[bridged](https://www.vagrantup.com/docs/networking/public_network.html)インターフェイスを有効にするには、ネットワークの`bridge`設定を構成し、ネットワークタイプを`public_network`へ変更します。 +[bridged](https://developer.hashicorp.com/vagrant/docs/networking/public_network)インターフェイスを有効にするには、ネットワークの`bridge`設定を構成し、ネットワークタイプを`public_network`へ変更します。 ```yaml networks: @@ -793,7 +793,7 @@ networks: bridge: "en1: Wi-Fi (AirPort)" ``` -[DHCP](https://www.vagrantup.com/docs/networking/public_network.html)を有効にするには、設定から`ip`オプションを削除するだけです。 +[DHCP](https://developer.hashicorp.com/vagrant/docs/networking/public_network#dhcp)を有効にするには、設定から`ip`オプションを削除するだけです。 ```yaml networks: @@ -801,6 +801,16 @@ networks: bridge: "en1: Wi-Fi (AirPort)" ``` +ネットワークで使用するデバイスを更新するには、ネットワークの設定へ`dev`オプションを追加します。デフォルトの`dev`値は`eth0`です。 + +```yaml +networks: + - type: "public_network" + ip: "192.168.10.20" + bridge: "en1: Wi-Fi (AirPort)" + dev: "enp2s0" +``` + ## Homesteadの拡張