Skip to content

Commit d8beb05

Browse files
committed
2025-08-25までの原文変更点を反映。
1 parent ba62e66 commit d8beb05

29 files changed

+193
-57
lines changed

original-en/artisan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ return [
494494
label: 'Search for a user:',
495495
placeholder: 'E.g. Taylor Otwell',
496496
options: fn ($value) => strlen($value) > 0
497-
? User::where('name', 'like', "%{$value}%")->pluck('name', 'id')->all()
497+
? User::whereLike('name', "%{$value}%")->pluck('name', 'id')->all()
498498
: []
499499
),
500500
];

original-en/authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ Auth::loginUsingId(1, remember: true);
409409
<a name="authenticate-a-user-once"></a>
410410
#### Authenticate a User Once
411411

412-
You may use the `once` method to authenticate a user with the application for a single request. No sessions or cookies will be utilized when calling this method:
412+
You may use the `once` method to authenticate a user with the application for a single request. No sessions or cookies will be utilized when calling this method, and the `Login` event will not be dispatched:
413413

414414
```php
415415
if (Auth::once($credentials)) {

original-en/cache.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ cache()->remember('users', $seconds, function () {
396396
```
397397

398398
> [!NOTE]
399-
> When testing call to the global `cache` function, you may use the `Cache::shouldReceive` method just as if you were [testing the facade](/docs/{{version}}/mocking#mocking-facades).
399+
> When testing calls to the global `cache` function, you may use the `Cache::shouldReceive` method just as if you were [testing the facade](/docs/{{version}}/mocking#mocking-facades).
400400
401401
<a name="atomic-locks"></a>
402402
## Atomic Locks

original-en/console-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ By default, the `Illuminate\Console\Events\CommandStarting` and `Illuminate\Cons
203203

204204
use Illuminate\Foundation\Testing\WithConsoleEvents;
205205

206-
uses(WithConsoleEvents::class);
206+
pest()->use(WithConsoleEvents::class);
207207

208208
// ...
209209
```

original-en/database-testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Before proceeding much further, let's discuss how to reset your database after e
2121

2222
use Illuminate\Foundation\Testing\RefreshDatabase;
2323

24-
uses(RefreshDatabase::class);
24+
pest()->use(RefreshDatabase::class);
2525

2626
test('basic example', function () {
2727
$response = $this->get('/');
@@ -98,7 +98,7 @@ use Database\Seeders\OrderStatusSeeder;
9898
use Database\Seeders\TransactionStatusSeeder;
9999
use Illuminate\Foundation\Testing\RefreshDatabase;
100100

101-
uses(RefreshDatabase::class);
101+
pest()->use(RefreshDatabase::class);
102102

103103
test('orders can be created', function () {
104104
// Run the DatabaseSeeder...

original-en/dusk.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@
5353
<a name="introduction"></a>
5454
## Introduction
5555

56+
> [!WARNING]
57+
> [Pest 4](https://pestphp.com/) now includes automated browser testing which offers significant performance and usability improvements compared to Laravel Dusk. For new projects, we recommend using Pest for browser testing.
58+
5659
[Laravel Dusk](https://github.com/laravel/dusk) provides an expressive, easy-to-use browser automation and testing API. By default, Dusk does not require you to install JDK or Selenium on your local computer. Instead, Dusk uses a standalone [ChromeDriver](https://sites.google.com/chromium.org/driver) installation. However, you are free to utilize any other Selenium compatible driver you wish.
5760

5861
<a name="installation"></a>
@@ -163,7 +166,7 @@ The `DatabaseMigrations` trait will run your database migrations before each tes
163166
use Illuminate\Foundation\Testing\DatabaseMigrations;
164167
use Laravel\Dusk\Browser;
165168

166-
uses(DatabaseMigrations::class);
169+
pest()->use(DatabaseMigrations::class);
167170

168171
//
169172
```
@@ -199,7 +202,7 @@ The `DatabaseTruncation` trait will migrate your database on the first test in o
199202
use Illuminate\Foundation\Testing\DatabaseTruncation;
200203
use Laravel\Dusk\Browser;
201204

202-
uses(DatabaseTruncation::class);
205+
pest()->use(DatabaseTruncation::class);
203206

204207
//
205208
```
@@ -357,7 +360,7 @@ use App\Models\User;
357360
use Illuminate\Foundation\Testing\DatabaseMigrations;
358361
use Laravel\Dusk\Browser;
359362

360-
uses(DatabaseMigrations::class);
363+
pest()->use(DatabaseMigrations::class);
361364

362365
test('basic example', function () {
363366
$user = User::factory()->create([
@@ -2474,7 +2477,7 @@ use Illuminate\Foundation\Testing\DatabaseMigrations;
24742477
use Laravel\Dusk\Browser;
24752478
use Tests\Browser\Components\DatePicker;
24762479

2477-
uses(DatabaseMigrations::class);
2480+
pest()->use(DatabaseMigrations::class);
24782481

24792482
test('basic example', function () {
24802483
$this->browse(function (Browser $browser) {

original-en/eloquent-collections.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,13 @@ class User extends Model
335335
*/
336336
public function newCollection(array $models = []): Collection
337337
{
338-
return new UserCollection($models);
338+
$collection = new UserCollection($models);
339+
340+
if (Model::isAutomaticallyEagerLoadingRelationships()) {
341+
$collection->withRelationshipAutoloading();
342+
}
343+
344+
return $collection;
339345
}
340346
}
341347
```

original-en/eloquent-serialization.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,20 @@ class User extends Model
131131
<a name="temporarily-modifying-attribute-visibility"></a>
132132
#### Temporarily Modifying Attribute Visibility
133133

134-
If you would like to make some typically hidden attributes visible on a given model instance, you may use the `makeVisible` method. The `makeVisible` method returns the model instance:
134+
If you would like to make some typically hidden attributes visible on a given model instance, you may use the `makeVisible` or `mergeVisible` methods. The `makeVisible` method returns the model instance:
135135

136136
```php
137137
return $user->makeVisible('attribute')->toArray();
138+
139+
return $user->mergeVisible(['name', 'email'])->toArray();
138140
```
139141

140-
Likewise, if you would like to hide some attributes that are typically visible, you may use the `makeHidden` method.
142+
Likewise, if you would like to hide some attributes that are typically visible, you may use the `makeHidden` or `mergeHidden` methods:
141143

142144
```php
143145
return $user->makeHidden('attribute')->toArray();
146+
147+
return $user->mergeHidden(['name', 'email'])->toArray();
144148
```
145149

146150
If you wish to temporarily override all of the visible or hidden attributes, you may use the `setVisible` and `setHidden` methods respectively:
@@ -203,11 +207,13 @@ Once the attribute has been added to the `appends` list, it will be included in
203207
<a name="appending-at-run-time"></a>
204208
#### Appending at Run Time
205209

206-
At runtime, you may instruct a model instance to append additional attributes using the `append` method. Or, you may use the `setAppends` method to override the entire array of appended properties for a given model instance:
210+
At runtime, you may instruct a model instance to append additional attributes using the `append` or `mergeAppends` methods. Or, you may use the `setAppends` method to override the entire array of appended properties for a given model instance:
207211

208212
```php
209213
return $user->append('is_admin')->toArray();
210214

215+
return $user->mergeAppends(['is_admin', 'status'])->toArray();
216+
211217
return $user->setAppends(['is_admin'])->toArray();
212218
```
213219

original-en/facades.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ use App\Models\Podcast;
257257
use Facades\App\Contracts\Publisher;
258258
use Illuminate\Foundation\Testing\RefreshDatabase;
259259

260-
uses(RefreshDatabase::class);
260+
pest()->use(RefreshDatabase::class);
261261

262262
test('podcast can be published', function () {
263263
$podcast = Podcast::factory()->create();

original-en/helpers.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Laravel includes a variety of global "helper" PHP functions. Many of these funct
7373
[Arr::prepend](#method-array-prepend)
7474
[Arr::prependKeysWith](#method-array-prependkeyswith)
7575
[Arr::pull](#method-array-pull)
76+
[Arr::push](#method-array-push)
7677
[Arr::query](#method-array-query)
7778
[Arr::random](#method-array-random)
7879
[Arr::reject](#method-array-reject)
@@ -959,6 +960,21 @@ use Illuminate\Support\Arr;
959960
$value = Arr::pull($array, $key, $default);
960961
```
961962

963+
<a name="method-array-push"></a>
964+
#### `Arr::push()` {.collection-method}
965+
966+
The `Arr::push` method pushes an item into an array using "dot" notation. If an array does not exist at the given key, it will be created:
967+
968+
```php
969+
use Illuminate\Support\Arr;
970+
971+
$array = [];
972+
973+
Arr::push($array, 'office.furniture', 'Desk');
974+
975+
// $array: ['office' => ['furniture' => 'Desk']]
976+
```
977+
962978
<a name="method-array-query"></a>
963979
#### `Arr::query()` {.collection-method}
964980

0 commit comments

Comments
 (0)