Skip to content

Commit 899ff86

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

Some content is hidden

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

44 files changed

+1127
-933
lines changed

Diff for: original-en/authorization.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ So far, we have only examined gates that return simple boolean values. However,
168168

169169
Gate::define('edit-settings', function (User $user) {
170170
return $user->isAdmin
171-
? Response::allow()
172-
: Response::deny('You must be an administrator.');
171+
? Response::allow()
172+
: Response::deny('You must be an administrator.');
173173
});
174174

175175
Even when you return an authorization response from your gate, the `Gate::allows` method will still return a simple boolean value; however, you may use the `Gate::inspect` method to get the full authorization response returned by the gate:
@@ -199,8 +199,8 @@ When an action is denied via a Gate, a `403` HTTP response is returned; however,
199199

200200
Gate::define('edit-settings', function (User $user) {
201201
return $user->isAdmin
202-
? Response::allow()
203-
: Response::denyWithStatus(404);
202+
? Response::allow()
203+
: Response::denyWithStatus(404);
204204
});
205205

206206
Because hiding resources via a `404` response is such a common pattern for web applications, the `denyAsNotFound` method is offered for convenience:
@@ -211,8 +211,8 @@ Because hiding resources via a `404` response is such a common pattern for web a
211211

212212
Gate::define('edit-settings', function (User $user) {
213213
return $user->isAdmin
214-
? Response::allow()
215-
: Response::denyAsNotFound();
214+
? Response::allow()
215+
: Response::denyAsNotFound();
216216
});
217217

218218
<a name="intercepting-gate-checks"></a>
@@ -362,8 +362,8 @@ So far, we have only examined policy methods that return simple boolean values.
362362
public function update(User $user, Post $post): Response
363363
{
364364
return $user->id === $post->user_id
365-
? Response::allow()
366-
: Response::deny('You do not own this post.');
365+
? Response::allow()
366+
: Response::deny('You do not own this post.');
367367
}
368368

369369
When returning an authorization response from your policy, the `Gate::allows` method will still return a simple boolean value; however, you may use the `Gate::inspect` method to get the full authorization response returned by the gate:
@@ -399,8 +399,8 @@ When an action is denied via a policy method, a `403` HTTP response is returned;
399399
public function update(User $user, Post $post): Response
400400
{
401401
return $user->id === $post->user_id
402-
? Response::allow()
403-
: Response::denyWithStatus(404);
402+
? Response::allow()
403+
: Response::denyWithStatus(404);
404404
}
405405

406406
Because hiding resources via a `404` response is such a common pattern for web applications, the `denyAsNotFound` method is offered for convenience:
@@ -415,8 +415,8 @@ Because hiding resources via a `404` response is such a common pattern for web a
415415
public function update(User $user, Post $post): Response
416416
{
417417
return $user->id === $post->user_id
418-
? Response::allow()
419-
: Response::denyAsNotFound();
418+
? Response::allow()
419+
: Response::denyAsNotFound();
420420
}
421421

422422
<a name="methods-without-models"></a>

Diff for: original-en/billing.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -842,8 +842,8 @@ The amount of time a customer has to pay their invoice before their subscription
842842
If you would like to set a specific [quantity](https://stripe.com/docs/billing/subscriptions/quantities) for the price when creating the subscription, you should invoke the `quantity` method on the subscription builder before creating the subscription:
843843

844844
$user->newSubscription('default', 'price_monthly')
845-
->quantity(5)
846-
->create($paymentMethod);
845+
->quantity(5)
846+
->create($paymentMethod);
847847

848848
<a name="additional-details"></a>
849849
#### Additional Details
@@ -862,14 +862,14 @@ If you would like to specify additional [customer](https://stripe.com/docs/api/c
862862
If you would like to apply a coupon when creating the subscription, you may use the `withCoupon` method:
863863

864864
$user->newSubscription('default', 'price_monthly')
865-
->withCoupon('code')
866-
->create($paymentMethod);
865+
->withCoupon('code')
866+
->create($paymentMethod);
867867

868868
Or, if you would like to apply a [Stripe promotion code](https://stripe.com/docs/billing/subscriptions/discounts/codes), you may use the `withPromotionCode` method:
869869

870870
$user->newSubscription('default', 'price_monthly')
871-
->withPromotionCode('promo_code_id')
872-
->create($paymentMethod);
871+
->withPromotionCode('promo_code_id')
872+
->create($paymentMethod);
873873

874874
The given promotion code ID should be the Stripe API ID assigned to the promotion code and not the customer facing promotion code. If you need to find a promotion code ID based on a given customer facing promotion code, you may use the `findPromotionCode` method:
875875

@@ -1104,8 +1104,8 @@ If the customer is on trial, the trial period will be maintained. Additionally,
11041104
If you would like to swap prices and cancel any trial period the customer is currently on, you may invoke the `skipTrial` method:
11051105

11061106
$user->subscription('default')
1107-
->skipTrial()
1108-
->swap('price_yearly');
1107+
->skipTrial()
1108+
->swap('price_yearly');
11091109

11101110
If you would like to swap prices and immediately invoice the customer instead of waiting for their next billing cycle, you may use the `swapAndInvoice` method:
11111111

@@ -1237,8 +1237,8 @@ If you want to swap a single price on a subscription, you may do so using the `s
12371237
$user = User::find(1);
12381238

12391239
$user->subscription('default')
1240-
->findItemOrFail('price_basic')
1241-
->swap('price_pro');
1240+
->findItemOrFail('price_basic')
1241+
->swap('price_pro');
12421242

12431243
<a name="proration"></a>
12441244
#### Proration
@@ -1329,9 +1329,9 @@ To start using usage billing, you will first need to create a new product in you
13291329
You may also start a metered subscription via [Stripe Checkout](#checkout):
13301330

13311331
$checkout = Auth::user()
1332-
->newSubscription('default', [])
1333-
->meteredPrice('price_metered')
1334-
->checkout();
1332+
->newSubscription('default', [])
1333+
->meteredPrice('price_metered')
1334+
->checkout();
13351335

13361336
return view('your-checkout-view', [
13371337
'checkout' => $checkout,
@@ -1441,8 +1441,8 @@ By default, the billing cycle anchor is the date the subscription was created or
14411441
$anchor = Carbon::parse('first day of next month');
14421442

14431443
$request->user()->newSubscription('default', 'price_monthly')
1444-
->anchorBillingCycleOn($anchor->startOfDay())
1445-
->create($request->paymentMethodId);
1444+
->anchorBillingCycleOn($anchor->startOfDay())
1445+
->create($request->paymentMethodId);
14461446

14471447
// ...
14481448
});
@@ -1507,8 +1507,8 @@ If you would like to offer trial periods to your customers while still collectin
15071507

15081508
Route::post('/user/subscribe', function (Request $request) {
15091509
$request->user()->newSubscription('default', 'price_monthly')
1510-
->trialDays(10)
1511-
->create($request->paymentMethodId);
1510+
->trialDays(10)
1511+
->create($request->paymentMethodId);
15121512

15131513
// ...
15141514
});
@@ -1523,8 +1523,8 @@ The `trialUntil` method allows you to provide a `DateTime` instance that specifi
15231523
use Carbon\Carbon;
15241524

15251525
$user->newSubscription('default', 'price_monthly')
1526-
->trialUntil(Carbon::now()->addDays(10))
1527-
->create($paymentMethod);
1526+
->trialUntil(Carbon::now()->addDays(10))
1527+
->create($paymentMethod);
15281528

15291529
You may determine if a user is within their trial period using either the `onTrial` method of the user instance or the `onTrial` method of the subscription instance. The two examples below are equivalent:
15301530

@@ -2131,7 +2131,7 @@ First, you could redirect your customer to the dedicated payment confirmation pa
21312131

21322132
try {
21332133
$subscription = $user->newSubscription('default', 'price_monthly')
2134-
->create($paymentMethod);
2134+
->create($paymentMethod);
21352135
} catch (IncompletePayment $exception) {
21362136
return redirect()->route(
21372137
'cashier.payment',

Diff for: original-en/configuration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
All of the configuration files for the Laravel framework are stored in the `config` directory. Each option is documented, so feel free to look through the files and get familiar with the options available to you.
1919

20-
These configuration files allow you to configure things like your database connection information, your mail server information, as well as various other core configuration values such as your application timezone and encryption key.
20+
These configuration files allow you to configure things like your database connection information, your mail server information, as well as various other core configuration values such as your application URL and encryption key.
2121

2222
<a name="the-about-command"></a>
2323
#### The `about` Command

Diff for: original-en/context.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,18 @@ $data = Context::all();
250250
<a name="determining-item-existence"></a>
251251
### Determining Item Existence
252252

253-
You may use the `has` method to determine if the context has any value stored for the given key:
253+
You may use the `has` and `missing` methods to determine if the context has any value stored for the given key:
254254

255255
```php
256256
use Illuminate\Support\Facades\Context;
257257

258258
if (Context::has('key')) {
259259
// ...
260260
}
261+
262+
if (Context::missing('key')) {
263+
// ...
264+
}
261265
```
262266

263267
The `has` method will return `true` regardless of the value stored. So, for example, a key with a `null` value will be considered present:

0 commit comments

Comments
 (0)