Skip to content

Commit 425ea89

Browse files
committed
2025-12-01までの原文変更点反映。
1 parent 878cb55 commit 425ea89

File tree

8 files changed

+326
-62
lines changed

8 files changed

+326
-62
lines changed

original-en/helpers.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- [Available Methods](#available-methods)
55
- [Other Utilities](#other-utilities)
66
- [Benchmarking](#benchmarking)
7-
- [Dates](#dates)
7+
- [Dates and Time](#dates)
88
- [Deferred Functions](#deferred-functions)
99
- [Lottery](#lottery)
1010
- [Pipeline](#pipeline)
@@ -3194,7 +3194,7 @@ Sometimes, you may want to benchmark the execution of a callback while still obt
31943194
```
31953195

31963196
<a name="dates"></a>
3197-
### Dates
3197+
### Dates and Time
31983198

31993199
Laravel includes [Carbon](https://carbon.nesbot.com/docs/), a powerful date and time manipulation library. To create a new `Carbon` instance, you may invoke the `now` function. This function is globally available within your Laravel application:
32003200

@@ -3210,8 +3210,33 @@ use Illuminate\Support\Carbon;
32103210
$now = Carbon::now();
32113211
```
32123212

3213+
Laravel also augments `Carbon` instances with `plus` and `minus` methods, allowing easy manipulation of the instance's date and time:
3214+
3215+
```php
3216+
return now()->plus(minutes: 5);
3217+
return now()->plus(hours: 8);
3218+
return now()->plus(weeks: 4);
3219+
3220+
return now()->minus(minutes: 5);
3221+
return now()->minus(hours: 8);
3222+
return now()->minus(weeks: 4);
3223+
```
3224+
32133225
For a thorough discussion of Carbon and its features, please consult the [official Carbon documentation](https://carbon.nesbot.com/docs/).
32143226

3227+
<a name="interval-functions"></a>
3228+
#### Interval Functions
3229+
3230+
Laravel also offers `seconds`, `minutes`, `hours`, `days`, and `years` functions that return `CarbonInterval` instances, which extend PHP's [DateInterval](https://www.php.net/manual/en/class.dateinterval.php) class. These functions may be used anywhere that Laravel accepts a `DateInterval` instance:
3231+
3232+
```php
3233+
use Illuminate\Support\Facades\Cache;
3234+
3235+
use function Illuminate\Support\{minutes};
3236+
3237+
Cache::put('metrics', $metrics, minutes(10));
3238+
```
3239+
32153240
<a name="deferred-functions"></a>
32163241
### Deferred Functions
32173242

original-en/pulse.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -650,31 +650,24 @@ When this card is included on the dashboard, Pulse will automatically include th
650650
<a name="custom-card-styling-tailwind"></a>
651651
#### Tailwind CSS
652652

653-
When using Tailwind CSS, you should create a dedicated Tailwind configuration file to avoid loading unnecessary CSS or conflicting with Pulse's Tailwind classes:
653+
When using Tailwind CSS, you should create a dedicated CSS entrypoint. The following example excludes Tailwind's [Preflight](https://tailwindcss.com/docs/preflight) base styles which are already included by Pulse, and scopes Tailwind using a CSS selector to avoid conflicts with Pulse's Tailwind classes:
654654

655-
```js
656-
export default {
657-
darkMode: 'class',
658-
important: '#top-sellers',
659-
content: [
660-
'./resources/views/livewire/pulse/top-sellers.blade.php',
661-
],
662-
corePlugins: {
663-
preflight: false,
664-
},
665-
};
666-
```
655+
```css
656+
@import "tailwindcss/theme.css";
667657

668-
You may then specify the configuration file in your CSS entrypoint:
658+
@custom-variant dark (&:where(.dark, .dark *));
659+
@source "./../../views/livewire/pulse/top-sellers.blade.php";
669660

670-
```css
671-
@config "../../tailwind.top-sellers.config.js";
672-
@tailwind base;
673-
@tailwind components;
674-
@tailwind utilities;
661+
@theme {
662+
/* ... */
663+
}
664+
665+
#top-sellers {
666+
@import "tailwindcss/utilities.css" source(none);
667+
}
675668
```
676669

677-
You will also need to include an `id` or `class` attribute in your card's view that matches the selector passed to Tailwind's [important selector strategy](https://tailwindcss.com/docs/configuration#selector-strategy):
670+
You will also need to include an `id` or `class` attribute in your card's view that matches the CSS selector in your entrypoint:
678671

679672
```blade
680673
<x-pulse::card id="top-sellers" :cols="$cols" :rows="$rows" class="$class">

original-en/queues.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
- [Queue Priorities](#queue-priorities)
4040
- [Queue Workers and Deployment](#queue-workers-and-deployment)
4141
- [Job Expirations and Timeouts](#job-expirations-and-timeouts)
42+
- [Pausing and Resuming Queue Workers](#pausing-and-resuming-queue-workers)
4243
- [Supervisor Configuration](#supervisor-configuration)
4344
- [Dealing With Failed Jobs](#dealing-with-failed-jobs)
4445
- [Cleaning Up After Failed Jobs](#cleaning-up-after-failed-jobs)
@@ -1561,7 +1562,7 @@ php artisan queue:work database
15611562
15621563
When a queue connection operation fails and failover is activated, Laravel will dispatch the `Illuminate\Queue\Events\QueueFailedOver` event, allowing you to report or log that a queue connection has failed.
15631564

1564-
> [!TIP]
1565+
> [!NOTE]
15651566
> If you use Laravel Horizon, remember that Horizon manages Redis queues only. If your failover list includes `database`, you should run a regular `php artisan queue:work database` process alongside Horizon.
15661567
15671568
<a name="error-handling"></a>
@@ -2291,6 +2292,27 @@ The `retry_after` configuration option and the `--timeout` CLI option are differ
22912292
> [!WARNING]
22922293
> The `--timeout` value should always be at least several seconds shorter than your `retry_after` configuration value. This will ensure that a worker processing a frozen job is always terminated before the job is retried. If your `--timeout` option is longer than your `retry_after` configuration value, your jobs may be processed twice.
22932294
2295+
<a name="pausing-and-resuming-queue-workers"></a>
2296+
### Pausing and Resuming Queue Workers
2297+
2298+
Sometimes you may need to temporarily prevent a queue worker from processing new jobs without stopping the worker entirely. For example, you may want to pause job processing during system maintenance. Laravel provides the `queue:pause` and `queue:continue` Artisan commands to pause and resume queue workers.
2299+
2300+
To pause a specific queue, provide the queue connection name and the queue name:
2301+
2302+
```shell
2303+
php artisan queue:pause database:default
2304+
```
2305+
2306+
In this example, `database` is the queue connection name and `default` is the queue name. Once a queue is paused, any workers processing jobs from that queue will continue to finish their current job, but will not pick up any new jobs until the queue is resumed.
2307+
2308+
To resume processing jobs on a paused queue, use the `queue:continue` command:
2309+
2310+
```shell
2311+
php artisan queue:continue database:default
2312+
```
2313+
2314+
After resuming a queue, workers will begin processing new jobs from that queue immediately. Note that pausing a queue does not stop the worker process itself - it only prevents the worker from processing new jobs from the specified queue.
2315+
22942316
<a name="supervisor-configuration"></a>
22952317
## Supervisor Configuration
22962318

original-en/starter-kits.md

Lines changed: 100 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
- [React](#react-customization)
1111
- [Vue](#vue-customization)
1212
- [Livewire](#livewire-customization)
13-
- [Two-Factor Authentication](#two-factor-authentication)
13+
- [Authentication](#authentication)
14+
- [Enabling and Disabling Features](#enabling-and-disabling-features)
15+
- [Customizing User Creation and Password Reset](#customizing-actions)
16+
- [Two-Factor Authentication](#two-factor-authentication)
17+
- [Rate Limiting](#rate-limiting)
1418
- [WorkOS AuthKit Authentication](#workos)
1519
- [Inertia SSR](#inertia-ssr)
1620
- [Community Maintained Starter Kits](#community-maintained-starter-kits)
@@ -270,18 +274,106 @@ To change your authentication layout, modify the layout that is used by your app
270274
</x-layouts.auth.split>
271275
```
272276

277+
<a name="authentication"></a>
278+
## Authentication
279+
280+
All starter kits use [Laravel Fortify](/docs/{{version}}/fortify) to handle authentication. Fortify provides routes, controllers, and logic for login, registration, password reset, email verification, and more.
281+
282+
Fortify automatically registers the following authentication routes based on the features that are enabled in your application's `config/fortify.php` configuration file:
283+
284+
| Route | Method | Description |
285+
| ---------------------------------- | ------ | ----------------------------------- |
286+
| `/login` | `GET` | Display login form |
287+
| `/login` | `POST` | Authenticate user |
288+
| `/logout` | `POST` | Log user out |
289+
| `/register` | `GET` | Display registration form |
290+
| `/register` | `POST` | Create new user |
291+
| `/forgot-password` | `GET` | Display password reset request form |
292+
| `/forgot-password` | `POST` | Send password reset link |
293+
| `/reset-password/{token}` | `GET` | Display password reset form |
294+
| `/reset-password` | `POST` | Update password |
295+
| `/email/verify` | `GET` | Display email verification notice |
296+
| `/email/verify/{id}/{hash}` | `GET` | Verify email address |
297+
| `/email/verification-notification` | `POST` | Resend verification email |
298+
| `/user/confirm-password` | `GET` | Display password confirmation form |
299+
| `/user/confirm-password` | `POST` | Confirm password |
300+
| `/two-factor-challenge` | `GET` | Display 2FA challenge form |
301+
| `/two-factor-challenge` | `POST` | Verify 2FA code |
302+
303+
The `php artisan route:list` Artisan command can be used to display all of the routes in your application.
304+
305+
<a name="enabling-and-disabling-features"></a>
306+
### Enabling and Disabling Features
307+
308+
You can control which Fortify features are enabled in your application's `config/fortify.php` configuration file:
309+
310+
```php
311+
use Laravel\Fortify\Features;
312+
313+
'features' => [
314+
Features::registration(),
315+
Features::resetPasswords(),
316+
Features::emailVerification(),
317+
Features::twoFactorAuthentication([
318+
'confirm' => true,
319+
'confirmPassword' => true,
320+
]),
321+
],
322+
```
323+
324+
If you want to disable a feature, simply comment out or remove that feature entry from the `features` array. For example, remove `Features::registration()` to disable public registration.
325+
326+
<a name="customizing-actions"></a>
327+
### Customizing User Creation and Password Reset
328+
329+
When a user registers or resets their password, Fortify invokes action classes located in your application's `app/Actions/Fortify` directory:
330+
331+
| File | Description |
332+
| ----------------------------- | ------------------------------------- |
333+
| `CreateNewUser.php` | Validates and creates new users |
334+
| `ResetUserPassword.php` | Validates and updates user passwords |
335+
| `PasswordValidationRules.php` | Defines password validation rules |
336+
337+
For example, to customize your application's registration logic, you should edit the `CreateNewUser` action:
338+
339+
```php
340+
public function create(array $input): User
341+
{
342+
Validator::make($input, [
343+
'name' => ['required', 'string', 'max:255'],
344+
'email' => ['required', 'email', 'max:255', 'unique:users'],
345+
'phone' => ['required', 'string', 'max:20'], // [tl! add]
346+
'password' => $this->passwordRules(),
347+
])->validate();
348+
349+
return User::create([
350+
'name' => $input['name'],
351+
'email' => $input['email'],
352+
'phone' => $input['phone'], // [tl! add]
353+
'password' => Hash::make($input['password']),
354+
]);
355+
}
356+
```
357+
273358
<a name="two-factor-authentication"></a>
274-
## Two-Factor Authentication
359+
### Two-Factor Authentication
360+
361+
Starter kits include built-in two-factor authentication (2FA), allowing users to secure their accounts using any TOTP-compatible authenticator app. 2FA is enabled by default via `Features::twoFactorAuthentication()` in your application's `config/fortify.php` configuration file.
275362

276-
All starter kits include built-in two-factor authentication (2FA) powered by [Laravel Fortify](/docs/{{version}}/fortify#two-factor-authentication), adding an extra layer of security to user accounts. Users can protect their accounts using any Time-based One-Time Password (TOTP) supporting authenticator application.
363+
The `confirm` option requires users to verify a code before 2FA is fully enabled, while `confirmPassword` requires password confirmation before enabling or disabling 2FA. For more details, see [Fortify's two-factor authentication documentation](/docs/{{version}}/fortify#two-factor-authentication).
277364

278-
Two-factor authentication is enabled by default and supports all options provided by [Fortify](/docs/{{version}}/fortify#two-factor-authentication):
365+
<a name="rate-limiting"></a>
366+
### Rate Limiting
367+
368+
Rate limiting prevents brute-forcing and repeated login attempts from overwhelming your authentication endpoints. You can customize Fortify's rate limiting behavior in your application's `FortifyServiceProvider`:
279369

280370
```php
281-
Features::twoFactorAuthentication([
282-
'confirm' => true,
283-
'confirmPassword' => true,
284-
]);
371+
use Illuminate\Support\Facades\RateLimiter;
372+
use Illuminate\Cache\RateLimiting\Limit;
373+
374+
RateLimiter::for('login', function ($request) {
375+
return Limit::perMinute(5)->by($request->email.$request->ip());
376+
});
285377
```
286378

287379
<a name="workos"></a>

translation-ja/helpers.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- [使用可能なメソッド](#available-methods)
55
- [その他のユーティリティ](#other-utilities)
66
- [ベンチマーク](#benchmarking)
7-
- [日付](#dates)
7+
- [日付と時間](#dates)
88
- [遅延関数](#deferred-functions)
99
- [抽選](#lottery)
1010
- [パイプライン](#pipeline)
@@ -3194,7 +3194,7 @@ Benchmark::dd(fn () => User::count(), iterations: 10); // 0.5 ms
31943194
```
31953195

31963196
<a name="dates"></a>
3197-
### 日付
3197+
### 日付と時間
31983198

31993199
Laravelは、強力な日付と時間の操作ライブラリである[Carbon](https://carbon.nesbot.com/docs/)を含んでいます。新しい`Carbon`インスタンスを作成するには、`now`関数を呼び出してください。この関数はLaravelアプリケーション内でグローバルに利用可能です。
32003200

@@ -3210,8 +3210,33 @@ use Illuminate\Support\Carbon;
32103210
$now = Carbon::now();
32113211
```
32123212

3213+
Laravelは`Carbon`インスタンスを`plus`および`minus`メソッドで拡張しており、インスタンスの日時を簡単に操作できるようになっています。
3214+
3215+
```php
3216+
return now()->plus(minutes: 5);
3217+
return now()->plus(hours: 8);
3218+
return now()->plus(weeks: 4);
3219+
3220+
return now()->minus(minutes: 5);
3221+
return now()->minus(hours: 8);
3222+
return now()->minus(weeks: 4);
3223+
```
3224+
32133225
Carbonの概要や特徴については、[Carbon公式ドキュメント](https://carbon.nesbot.com/docs/)を参照してください。
32143226

3227+
<a name="interval-functions"></a>
3228+
#### インターバル関数
3229+
3230+
LaravelはPHPの[DateInterval](https://www.php.net/manual/en/class.dateinterval.php)クラスを拡張した`CarbonInterval`インスタンスを返す、`seconds``minutes``hours``days``years`関数も提供しています。これらの関数は、LaravelがDateIntervalインスタンスを受け付けるあらゆる場所で使用できます。
3231+
3232+
```php
3233+
use Illuminate\Support\Facades\Cache;
3234+
3235+
use function Illuminate\Support\{minutes};
3236+
3237+
Cache::put('metrics', $metrics, minutes(10));
3238+
```
3239+
32153240
<a name="deferred-functions"></a>
32163241
### 遅延関数
32173242

translation-ja/pulse.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -650,31 +650,24 @@ class TopSellers extends Card
650650
<a name="custom-card-styling-tailwind"></a>
651651
#### Tailwind CSS
652652

653-
Tailwind CSSを使用する場合は、不要なCSSを読み込んだり、PulseのTailwindクラスと競合しないように、専用のTailwind設定ファイルを作成する必要があります
653+
Tailwind CSSを使用する際は、専用のCSSエントリポイントを作成する必要があります。以下の例では、Pulseによりあらかじめ組み込まれているTailwindの[Preflight](https://tailwindcss.com/docs/preflight)ベーススタイルを除外し、PulseのTailwindクラスとの競合を避けるためCSSセレクタを使用してTailwindをスコープ化しています
654654

655-
```js
656-
export default {
657-
darkMode: 'class',
658-
important: '#top-sellers',
659-
content: [
660-
'./resources/views/livewire/pulse/top-sellers.blade.php',
661-
],
662-
corePlugins: {
663-
preflight: false,
664-
},
665-
};
666-
```
655+
```css
656+
@import "tailwindcss/theme.css";
667657

668-
それから、CSSエントリーポイントに設定ファイルを指定します。
658+
@custom-variant dark (&:where(.dark, .dark *));
659+
@source "./../../views/livewire/pulse/top-sellers.blade.php";
669660

670-
```css
671-
@config "../../tailwind.top-sellers.config.js";
672-
@tailwind base;
673-
@tailwind components;
674-
@tailwind utilities;
661+
@theme {
662+
/* ... */
663+
}
664+
665+
#top-sellers {
666+
@import "tailwindcss/utilities.css" source(none);
667+
}
675668
```
676669

677-
また、カードのビューに、Tailwindの[importantセレクタ戦略](https://tailwindcss.com/docs/configuration#selector-strategy)へ渡したセレクタにマッチする`id`属性または`class`属性を含める必要があります。
670+
また、カードビューに`id`または`class`属性を追加し、エントリポイントのCSSセレクタと一致させる必要があります:
678671

679672
```blade
680673
<x-pulse::card id="top-sellers" :cols="$cols" :rows="$rows" class="$class">

0 commit comments

Comments
 (0)