Skip to content

Commit 07a5d43

Browse files
committed
2025-02-24までの原文変更点反映。
1 parent 899ff86 commit 07a5d43

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1078
-918
lines changed

original-en/billing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,7 @@ You may pass an array of prices to the `previewInvoice` method in order to previ
18821882

18831883
Before generating invoice PDFs, you should use Composer to install the Dompdf library, which is the default invoice renderer for Cashier:
18841884

1885-
```php
1885+
```shell
18861886
composer require dompdf/dompdf
18871887
```
18881888

original-en/cashier-paddle.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,8 +1081,9 @@ If you would like to offer trial periods to your customers while still collectin
10811081
use Illuminate\Http\Request;
10821082

10831083
Route::get('/user/subscribe', function (Request $request) {
1084-
$checkout = $request->user()->subscribe('pri_monthly')
1085-
->returnTo(route('home'));
1084+
$checkout = $request->user()
1085+
->subscribe('pri_monthly')
1086+
->returnTo(route('home'));
10861087

10871088
return view('billing', ['checkout' => $checkout]);
10881089
});
@@ -1147,7 +1148,8 @@ Once you are ready to create an actual subscription for the user, you may use th
11471148
use Illuminate\Http\Request;
11481149

11491150
Route::get('/user/subscribe', function (Request $request) {
1150-
$checkout = $user->subscribe('pri_monthly')
1151+
$checkout = $request->user()
1152+
->subscribe('pri_monthly')
11511153
->returnTo(route('home'));
11521154

11531155
return view('billing', ['checkout' => $checkout]);

original-en/configuration.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,11 @@ When accessing this hidden route, you will then be redirected to the `/` route o
310310

311311
By default, Laravel determines if your application is in maintenance mode using a file-based system. This means to activate maintenance mode, the `php artisan down` command has to be executed on each server hosting your application.
312312

313-
Alternatively, Laravel offers a cache-based method for handling maintenance mode. This method requires running the `php artisan down` command on just one server. To use this approach, modify the "driver" setting in the `config/app.php` file of your application to `cache`. Then, select a cache `store` that is accessible by all your servers. This ensures the maintenance mode status is consistently maintained across every server:
313+
Alternatively, Laravel offers a cache-based method for handling maintenance mode. This method requires running the `php artisan down` command on just one server. To use this approach, modify the maintenance mode variables in your application's `.env` file. You should select a cache `store` that is accessible by all of your servers. This ensures the maintenance mode status is consistently maintained across every server:
314314

315-
```php
316-
'maintenance' => [
317-
'driver' => 'cache',
318-
'store' => 'database',
319-
],
315+
```ini
316+
APP_MAINTENANCE_DRIVER=cache
317+
APP_MAINTENANCE_STORE=database
320318
```
321319

322320
<a name="pre-rendering-the-maintenance-mode-view"></a>

original-en/console-tests.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ You may test this command with the following test:
6363
```php tab=Pest
6464
test('console command', function () {
6565
$this->artisan('question')
66-
->expectsQuestion('What is your name?', 'Taylor Otwell')
67-
->expectsQuestion('Which language do you prefer?', 'PHP')
68-
->expectsOutput('Your name is Taylor Otwell and you prefer PHP.')
69-
->doesntExpectOutput('Your name is Taylor Otwell and you prefer Ruby.')
70-
->assertExitCode(0);
66+
->expectsQuestion('What is your name?', 'Taylor Otwell')
67+
->expectsQuestion('Which language do you prefer?', 'PHP')
68+
->expectsOutput('Your name is Taylor Otwell and you prefer PHP.')
69+
->doesntExpectOutput('Your name is Taylor Otwell and you prefer Ruby.')
70+
->assertExitCode(0);
7171
});
7272
```
7373

@@ -78,11 +78,11 @@ test('console command', function () {
7878
public function test_console_command(): void
7979
{
8080
$this->artisan('question')
81-
->expectsQuestion('What is your name?', 'Taylor Otwell')
82-
->expectsQuestion('Which language do you prefer?', 'PHP')
83-
->expectsOutput('Your name is Taylor Otwell and you prefer PHP.')
84-
->doesntExpectOutput('Your name is Taylor Otwell and you prefer Ruby.')
85-
->assertExitCode(0);
81+
->expectsQuestion('What is your name?', 'Taylor Otwell')
82+
->expectsQuestion('Which language do you prefer?', 'PHP')
83+
->expectsOutput('Your name is Taylor Otwell and you prefer PHP.')
84+
->doesntExpectOutput('Your name is Taylor Otwell and you prefer Ruby.')
85+
->assertExitCode(0);
8686
}
8787
```
8888

@@ -91,12 +91,12 @@ If you are utilizing the `search` or `multisearch` functions provided by [Larave
9191
```php tab=Pest
9292
test('console command', function () {
9393
$this->artisan('example')
94-
->expectsSearch('What is your name?', search: 'Tay', answers: [
94+
->expectsSearch('What is your name?', search: 'Tay', answers: [
9595
'Taylor Otwell',
9696
'Taylor Swift',
9797
'Darian Taylor'
98-
], answer: 'Taylor Otwell')
99-
->assertExitCode(0);
98+
], answer: 'Taylor Otwell')
99+
->assertExitCode(0);
100100
});
101101
```
102102

@@ -107,12 +107,12 @@ test('console command', function () {
107107
public function test_console_command(): void
108108
{
109109
$this->artisan('example')
110-
->expectsSearch('What is your name?', search: 'Tay', answers: [
110+
->expectsSearch('What is your name?', search: 'Tay', answers: [
111111
'Taylor Otwell',
112112
'Taylor Swift',
113113
'Darian Taylor'
114-
], answer: 'Taylor Otwell')
115-
->assertExitCode(0);
114+
], answer: 'Taylor Otwell')
115+
->assertExitCode(0);
116116
}
117117
```
118118

@@ -121,8 +121,8 @@ You may also assert that a console command does not generate any output using th
121121
```php tab=Pest
122122
test('console command', function () {
123123
$this->artisan('example')
124-
->doesntExpectOutput()
125-
->assertExitCode(0);
124+
->doesntExpectOutput()
125+
->assertExitCode(0);
126126
});
127127
```
128128

@@ -143,8 +143,8 @@ The `expectsOutputToContain` and `doesntExpectOutputToContain` methods may be us
143143
```php tab=Pest
144144
test('console command', function () {
145145
$this->artisan('example')
146-
->expectsOutputToContain('Taylor')
147-
->assertExitCode(0);
146+
->expectsOutputToContain('Taylor')
147+
->assertExitCode(0);
148148
});
149149
```
150150

original-en/container.md

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -222,16 +222,16 @@ Sometimes you may have two classes that utilize the same interface, but you wish
222222
use Illuminate\Support\Facades\Storage;
223223

224224
$this->app->when(PhotoController::class)
225-
->needs(Filesystem::class)
226-
->give(function () {
227-
return Storage::disk('local');
228-
});
225+
->needs(Filesystem::class)
226+
->give(function () {
227+
return Storage::disk('local');
228+
});
229229

230230
$this->app->when([VideoController::class, UploadController::class])
231-
->needs(Filesystem::class)
232-
->give(function () {
233-
return Storage::disk('s3');
234-
});
231+
->needs(Filesystem::class)
232+
->give(function () {
233+
return Storage::disk('s3');
234+
});
235235

236236
<a name="contextual-attributes"></a>
237237
### Contextual Attributes
@@ -312,34 +312,38 @@ Route::get('/user', function (#[CurrentUser] User $user) {
312312

313313
You can create your own contextual attributes by implementing the `Illuminate\Contracts\Container\ContextualAttribute` contract. The container will call your attribute's `resolve` method, which should resolve the value that should be injected into the class utilizing the attribute. In the example below, we will re-implement Laravel's built-in `Config` attribute:
314314

315-
<?php
315+
```php
316+
<?php
316317

317-
namespace App\Attributes;
318+
namespace App\Attributes;
318319

319-
use Illuminate\Contracts\Container\ContextualAttribute;
320+
use Attribute;
321+
use Illuminate\Contracts\Container\Container;
322+
use Illuminate\Contracts\Container\ContextualAttribute;
320323

321-
#[Attribute(Attribute::TARGET_PARAMETER)]
322-
class Config implements ContextualAttribute
324+
#[Attribute(Attribute::TARGET_PARAMETER)]
325+
class Config implements ContextualAttribute
326+
{
327+
/**
328+
* Create a new attribute instance.
329+
*/
330+
public function __construct(public string $key, public mixed $default = null)
323331
{
324-
/**
325-
* Create a new attribute instance.
326-
*/
327-
public function __construct(public string $key, public mixed $default = null)
328-
{
329-
}
332+
}
330333

331-
/**
332-
* Resolve the configuration value.
333-
*
334-
* @param self $attribute
335-
* @param \Illuminate\Contracts\Container\Container $container
336-
* @return mixed
337-
*/
338-
public static function resolve(self $attribute, Container $container)
339-
{
340-
return $container->make('config')->get($attribute->key, $attribute->default);
341-
}
334+
/**
335+
* Resolve the configuration value.
336+
*
337+
* @param self $attribute
338+
* @param \Illuminate\Contracts\Container\Container $container
339+
* @return mixed
340+
*/
341+
public static function resolve(self $attribute, Container $container)
342+
{
343+
return $container->make('config')->get($attribute->key, $attribute->default);
342344
}
345+
}
346+
```
343347

344348
<a name="binding-primitives"></a>
345349
### Binding Primitives
@@ -349,8 +353,8 @@ Sometimes you may have a class that receives some injected classes, but also nee
349353
use App\Http\Controllers\UserController;
350354

351355
$this->app->when(UserController::class)
352-
->needs('$variableName')
353-
->give($value);
356+
->needs('$variableName')
357+
->give($value);
354358

355359
Sometimes a class may depend on an array of [tagged](#tagging) instances. Using the `giveTagged` method, you may easily inject all of the container bindings with that tag:
356360

@@ -397,24 +401,24 @@ Occasionally, you may have a class that receives an array of typed objects using
397401
Using contextual binding, you may resolve this dependency by providing the `give` method with a closure that returns an array of resolved `Filter` instances:
398402

399403
$this->app->when(Firewall::class)
400-
->needs(Filter::class)
401-
->give(function (Application $app) {
402-
return [
403-
$app->make(NullFilter::class),
404-
$app->make(ProfanityFilter::class),
405-
$app->make(TooLongFilter::class),
406-
];
407-
});
404+
->needs(Filter::class)
405+
->give(function (Application $app) {
406+
return [
407+
$app->make(NullFilter::class),
408+
$app->make(ProfanityFilter::class),
409+
$app->make(TooLongFilter::class),
410+
];
411+
});
408412

409413
For convenience, you may also just provide an array of class names to be resolved by the container whenever `Firewall` needs `Filter` instances:
410414

411415
$this->app->when(Firewall::class)
412-
->needs(Filter::class)
413-
->give([
414-
NullFilter::class,
415-
ProfanityFilter::class,
416-
TooLongFilter::class,
417-
]);
416+
->needs(Filter::class)
417+
->give([
418+
NullFilter::class,
419+
ProfanityFilter::class,
420+
TooLongFilter::class,
421+
]);
418422

419423
<a name="variadic-tag-dependencies"></a>
420424
#### Variadic Tag Dependencies

original-en/controllers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,9 @@ Typically, a 404 HTTP response will be generated if an implicitly bound resource
208208
use Illuminate\Support\Facades\Redirect;
209209

210210
Route::resource('photos', PhotoController::class)
211-
->missing(function (Request $request) {
212-
return Redirect::route('photos.index');
213-
});
211+
->missing(function (Request $request) {
212+
return Redirect::route('photos.index');
213+
});
214214

215215
<a name="soft-deleted-models"></a>
216216
#### Soft Deleted Models

original-en/database.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,10 @@ public function boot(): void
464464
{
465465
Event::listen(function (DatabaseBusy $event) {
466466
Notification::route('mail', '[email protected]')
467-
->notify(new DatabaseApproachingMaxConnections(
468-
$event->connectionName,
469-
$event->connections
470-
));
467+
->notify(new DatabaseApproachingMaxConnections(
468+
$event->connectionName,
469+
$event->connections
470+
));
471471
});
472472
}
473473
```

original-en/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@
106106
- [Socialite](/docs/{{version}}/socialite)
107107
- [Telescope](/docs/{{version}}/telescope)
108108
- [Valet](/docs/{{version}}/valet)
109-
- [API Documentation](/api/11.x)
109+
- [API Documentation](https://api.laravel.com/docs/11.x)

0 commit comments

Comments
 (0)