Skip to content

Commit f63817c

Browse files
committed
fix conflicts
2 parents 38946b4 + 0790883 commit f63817c

Some content is hidden

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

43 files changed

+1297
-945
lines changed

authorization.md

Lines changed: 12 additions & 12 deletions
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>

billing.md

Lines changed: 20 additions & 20 deletions
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',

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]);

configuration.md

Lines changed: 1 addition & 1 deletion
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

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

container.md

Lines changed: 24 additions & 24 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
@@ -349,8 +349,8 @@ Sometimes you may have a class that receives some injected classes, but also nee
349349
use App\Http\Controllers\UserController;
350350

351351
$this->app->when(UserController::class)
352-
->needs('$variableName')
353-
->give($value);
352+
->needs('$variableName')
353+
->give($value);
354354

355355
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:
356356

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

399399
$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-
});
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+
});
408408

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

411411
$this->app->when(Firewall::class)
412-
->needs(Filter::class)
413-
->give([
414-
NullFilter::class,
415-
ProfanityFilter::class,
416-
TooLongFilter::class,
417-
]);
412+
->needs(Filter::class)
413+
->give([
414+
NullFilter::class,
415+
ProfanityFilter::class,
416+
TooLongFilter::class,
417+
]);
418418

419419
<a name="variadic-tag-dependencies"></a>
420420
#### Variadic Tag Dependencies

context.md

Lines changed: 5 additions & 1 deletion
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:

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

0 commit comments

Comments
 (0)