Skip to content

Commit bc0e908

Browse files
committed
2025-09-22までの原文変更点反映(mcpページ仮訳)。
1 parent fdf8398 commit bc0e908

22 files changed

+2880
-32
lines changed

original-en/cache.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [Removing Items From the Cache](#removing-items-from-the-cache)
1111
- [Cache Memoization](#cache-memoization)
1212
- [The Cache Helper](#the-cache-helper)
13+
- [Cache Tags](#cache-tags)
1314
- [Atomic Locks](#atomic-locks)
1415
- [Managing Locks](#managing-locks)
1516
- [Managing Locks Across Processes](#managing-locks-across-processes)
@@ -398,6 +399,42 @@ cache()->remember('users', $seconds, function () {
398399
> [!NOTE]
399400
> 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).
400401
402+
<a name="cache-tags"></a>
403+
## Cache Tags
404+
405+
> [!WARNING]
406+
> Cache tags are not supported when using the `file`, `dynamodb`, or `database` cache drivers.
407+
408+
<a name="storing-tagged-cache-items"></a>
409+
### Storing Tagged Cache Items
410+
411+
Cache tags allow you to tag related items in the cache and then flush all cached values that have been assigned a given tag. You may access a tagged cache by passing in an ordered array of tag names. For example, let's access a tagged cache and `put` a value into the cache:
412+
413+
use Illuminate\Support\Facades\Cache;
414+
415+
Cache::tags(['people', 'artists'])->put('John', $john, $seconds);
416+
Cache::tags(['people', 'authors'])->put('Anne', $anne, $seconds);
417+
418+
<a name="accessing-tagged-cache-items"></a>
419+
### Accessing Tagged Cache Items
420+
421+
Items stored via tags may not be accessed without also providing the tags that were used to store the value. To retrieve a tagged cache item, pass the same ordered list of tags to the `tags` method, then call the `get` method with the key you wish to retrieve:
422+
423+
$john = Cache::tags(['people', 'artists'])->get('John');
424+
425+
$anne = Cache::tags(['people', 'authors'])->get('Anne');
426+
427+
<a name="removing-tagged-cache-items"></a>
428+
### Removing Tagged Cache Items
429+
430+
You may flush all items that are assigned a tag or list of tags. For example, the following code would remove all caches tagged with either `people`, `authors`, or both. So, both `Anne` and `John` would be removed from the cache:
431+
432+
Cache::tags(['people', 'authors'])->flush();
433+
434+
In contrast, the code below would remove only cached values tagged with `authors`, so `Anne` would be removed, but not `John`:
435+
436+
Cache::tags('authors')->flush();
437+
401438
<a name="atomic-locks"></a>
402439
## Atomic Locks
403440

original-en/collections.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3745,25 +3745,25 @@ $filtered->all();
37453745
*/
37463746
```
37473747

3748-
The `where` method uses "loose" comparisons when checking item values, meaning a string with an integer value will be considered equal to an integer of the same value. Use the [whereStrict](#method-wherestrict) method to filter using "strict" comparisons.
3748+
The `where` method uses "loose" comparisons when checking item values, meaning a string with an integer value will be considered equal to an integer of the same value. Use the [whereStrict](#method-wherestrict) method to filter using "strict" comparisons, or the [whereNull](#method-wherenull) and [whereNotNull](#method-wherenotnull) methods to filter for `null` values.
37493749

37503750
Optionally, you may pass a comparison operator as the second parameter. Supported operators are: '===', '!==', '!=', '==', '=', '<>', '>', '<', '>=', and '<=':
37513751

37523752
```php
37533753
$collection = collect([
3754-
['name' => 'Jim', 'deleted_at' => '2019-01-01 00:00:00'],
3755-
['name' => 'Sally', 'deleted_at' => '2019-01-02 00:00:00'],
3756-
['name' => 'Sue', 'deleted_at' => null],
3754+
['name' => 'Jim', 'platform' => 'Mac'],
3755+
['name' => 'Sally', 'platform' => 'Mac'],
3756+
['name' => 'Sue', 'platform' => 'Linux'],
37573757
]);
37583758

3759-
$filtered = $collection->where('deleted_at', '!=', null);
3759+
$filtered = $collection->where('platform', '!=', 'Linux');
37603760

37613761
$filtered->all();
37623762

37633763
/*
37643764
[
3765-
['name' => 'Jim', 'deleted_at' => '2019-01-01 00:00:00'],
3766-
['name' => 'Sally', 'deleted_at' => '2019-01-02 00:00:00'],
3765+
['name' => 'Jim', 'platform' => 'Mac'],
3766+
['name' => 'Sally', 'platform' => 'Mac'],
37673767
]
37683768
*/
37693769
```
@@ -3922,6 +3922,8 @@ $collection = collect([
39223922
['name' => 'Desk'],
39233923
['name' => null],
39243924
['name' => 'Bookcase'],
3925+
['name' => 0],
3926+
['name' => ''],
39253927
]);
39263928

39273929
$filtered = $collection->whereNotNull('name');
@@ -3932,6 +3934,8 @@ $filtered->all();
39323934
[
39333935
['name' => 'Desk'],
39343936
['name' => 'Bookcase'],
3937+
['name' => 0],
3938+
['name' => ''],
39353939
]
39363940
*/
39373941
```
@@ -3946,6 +3950,8 @@ $collection = collect([
39463950
['name' => 'Desk'],
39473951
['name' => null],
39483952
['name' => 'Bookcase'],
3953+
['name' => 0],
3954+
['name' => ''],
39493955
]);
39503956

39513957
$filtered = $collection->whereNull('name');

original-en/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ APP_NAME="My Application"
9898
All of the variables listed in the `.env` file will be loaded into the `$_ENV` PHP super-global when your application receives a request. However, you may use the `env` function to retrieve values from these variables in your configuration files. In fact, if you review the Laravel configuration files, you will notice many of the options are already using this function:
9999

100100
```php
101-
'debug' => env('APP_DEBUG', false),
101+
'debug' => (bool) env('APP_DEBUG', false),
102102
```
103103

104104
The second value passed to the `env` function is the "default value". This value will be returned if no environment variable exists for the given key.

original-en/contributions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ The Laravel source code is managed on GitHub, and there are repositories for eac
3838
- [Laravel Framework](https://github.com/laravel/framework)
3939
- [Laravel Homestead](https://github.com/laravel/homestead) ([Build Scripts](https://github.com/laravel/settler))
4040
- [Laravel Horizon](https://github.com/laravel/horizon)
41-
- [Laravel Livewire Starter Kit](https://github.com/laravel/livewire-starter-kit)
4241
- [Laravel Passport](https://github.com/laravel/passport)
4342
- [Laravel Pennant](https://github.com/laravel/pennant)
4443
- [Laravel Pint](https://github.com/laravel/pint)
4544
- [Laravel Prompts](https://github.com/laravel/prompts)
46-
- [Laravel React Starter Kit](https://github.com/laravel/react-starter-kit)
4745
- [Laravel Reverb](https://github.com/laravel/reverb)
4846
- [Laravel Sail](https://github.com/laravel/sail)
4947
- [Laravel Sanctum](https://github.com/laravel/sanctum)
5048
- [Laravel Scout](https://github.com/laravel/scout)
5149
- [Laravel Socialite](https://github.com/laravel/socialite)
5250
- [Laravel Telescope](https://github.com/laravel/telescope)
51+
- [Laravel Livewire Starter Kit](https://github.com/laravel/livewire-starter-kit)
52+
- [Laravel React Starter Kit](https://github.com/laravel/react-starter-kit)
5353
- [Laravel Vue Starter Kit](https://github.com/laravel/vue-starter-kit)
5454

5555
</div>

original-en/documentation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
- [Folio](/docs/{{version}}/folio)
9090
- [Homestead](/docs/{{version}}/homestead)
9191
- [Horizon](/docs/{{version}}/horizon)
92+
- [MCP](/docs/{{version}}/mcp)
9293
- [Mix](/docs/{{version}}/mix)
9394
- [Octane](/docs/{{version}}/octane)
9495
- [Passport](/docs/{{version}}/passport)

original-en/dusk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2602,7 +2602,7 @@ jobs:
26022602
DB_PASSWORD: root
26032603
MAIL_MAILER: log
26042604
steps:
2605-
- uses: actions/checkout@v4
2605+
- uses: actions/checkout@v5
26062606
- name: Prepare The Environment
26072607
run: cp .env.example .env
26082608
- name: Create Database

original-en/eloquent-factories.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,14 @@ $users = User::factory()
319319
->create();
320320
```
321321

322-
Within a sequence closure, you may access the `$index` or `$count` properties on the sequence instance that is injected into the closure. The `$index` property contains the number of iterations through the sequence that have occurred thus far, while the `$count` property contains the total number of times the sequence will be invoked:
322+
Within a sequence closure, you may access the `$index` property on the sequence instance that is injected into the closure. The `$index` property contains the number of iterations through the sequence that have occurred thus far:
323323

324324
```php
325325
$users = User::factory()
326326
->count(10)
327-
->sequence(fn (Sequence $sequence) => ['name' => 'Name '.$sequence->index])
327+
->state(new Sequence(
328+
fn (Sequence $sequence) => ['name' => 'Name '.$sequence->index],
329+
))
328330
->create();
329331
```
330332

original-en/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ class SendShipmentNotification implements ShouldQueue
556556

557557
If one of your queued listeners is encountering an error, you likely do not want it to keep retrying indefinitely. Therefore, Laravel provides various ways to specify how many times or for how long a listener may be attempted.
558558

559-
You may define a `tries` property on your listener class to specify how many times the listener may be attempted before it is considered to have failed:
559+
You may define a `tries` property or method on your listener class to specify how many times the listener may be attempted before it is considered to have failed:
560560

561561
```php
562562
<?php

0 commit comments

Comments
 (0)