Skip to content

Commit 4da19a5

Browse files
committed
update date modification
1 parent 6d46a8e commit 4da19a5

18 files changed

+46
-46
lines changed

artisan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ use DateInterval;
285285
*/
286286
public function isolationLockExpiresAt(): DateTimeInterface|DateInterval
287287
{
288-
return now()->addMinutes(5);
288+
return now()->plus(minutes: 5);
289289
}
290290
```
291291

billing.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,7 @@ You may also choose to cancel the subscription at a specific moment in time:
17041704

17051705
```php
17061706
$user->subscription('default')->cancelAt(
1707-
now()->addDays(10)
1707+
now()->plus(days: 10)
17081708
);
17091709
```
17101710

@@ -1758,7 +1758,7 @@ The `trialUntil` method allows you to provide a `DateTime` instance that specifi
17581758
use Illuminate\Support\Carbon;
17591759

17601760
$user->newSubscription('default', 'price_monthly')
1761-
->trialUntil(Carbon::now()->addDays(10))
1761+
->trialUntil(Carbon::now()->plus(days: 10))
17621762
->create($paymentMethod);
17631763
```
17641764

@@ -1807,7 +1807,7 @@ use App\Models\User;
18071807

18081808
$user = User::create([
18091809
// ...
1810-
'trial_ends_at' => now()->addDays(10),
1810+
'trial_ends_at' => now()->plus(days: 10),
18111811
]);
18121812
```
18131813

@@ -1858,12 +1858,12 @@ $subscription = User::find(1)->subscription('default');
18581858

18591859
// End the trial 7 days from now...
18601860
$subscription->extendTrial(
1861-
now()->addDays(7)
1861+
now()->plus(days: 7)
18621862
);
18631863

18641864
// Add an additional 5 days to the trial...
18651865
$subscription->extendTrial(
1866-
$subscription->trial_ends_at->addDays(5)
1866+
$subscription->trial_ends_at->plus(days: 5)
18671867
);
18681868
```
18691869

cache.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ The `increment` and `decrement` methods may be used to adjust the value of integ
204204

205205
```php
206206
// Initialize the value if it does not exist...
207-
Cache::add('key', 0, now()->addHours(4));
207+
Cache::add('key', 0, now()->plus(hours: 4));
208208

209209
// Increment or decrement the value...
210210
Cache::increment('key');
@@ -278,7 +278,7 @@ Cache::put('key', 'value');
278278
Instead of passing the number of seconds as an integer, you may also pass a `DateTime` instance representing the desired expiration time of the cached item:
279279

280280
```php
281-
Cache::put('key', 'value', now()->addMinutes(10));
281+
Cache::put('key', 'value', now()->plus(minutes: 10));
282282
```
283283

284284
<a name="store-if-not-present"></a>
@@ -386,7 +386,7 @@ If you provide an array of key / value pairs and an expiration time to the funct
386386
```php
387387
cache(['key' => 'value'], $seconds);
388388

389-
cache(['key' => 'value'], now()->addMinutes(10));
389+
cache(['key' => 'value'], now()->plus(minutes: 10));
390390
```
391391

392392
When the `cache` function is called without any arguments, it returns an instance of the `Illuminate\Contracts\Cache\Factory` implementation, allowing you to call other caching methods:

cashier-paddle.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,13 +1150,13 @@ $user->subscription()->pauseNow();
11501150
Using the `pauseUntil` method, you can pause the subscription until a specific moment in time:
11511151

11521152
```php
1153-
$user->subscription()->pauseUntil(now()->addMonth());
1153+
$user->subscription()->pauseUntil(now()->plus(months: 1));
11541154
```
11551155

11561156
Or, you may use the `pauseNowUntil` method to immediately pause the subscription until a given point in time:
11571157

11581158
```php
1159-
$user->subscription()->pauseNowUntil(now()->addMonth());
1159+
$user->subscription()->pauseNowUntil(now()->plus(months: 1));
11601160
```
11611161

11621162
You may determine if a user has paused their subscription but are still on their "grace period" using the `onPausedGracePeriod` method:
@@ -1276,7 +1276,7 @@ $user = User::create([
12761276
]);
12771277

12781278
$user->createAsCustomer([
1279-
'trial_ends_at' => now()->addDays(10)
1279+
'trial_ends_at' => now()->plus(days: 10)
12801280
]);
12811281
```
12821282

@@ -1324,7 +1324,7 @@ if ($user->onGenericTrial()) {
13241324
You can extend an existing trial period on a subscription by invoking the `extendTrial` method and specifying the moment in time that the trial should end:
13251325

13261326
```php
1327-
$user->subscription()->extendTrial(now()->addDays(5));
1327+
$user->subscription()->extendTrial(now()->plus(days: 5));
13281328
```
13291329

13301330
Or, you may immediately activate a subscription by ending its trial by calling the `activate` method on the subscription:

collections.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4254,7 +4254,7 @@ The `takeUntilTimeout` method returns a new lazy collection that will enumerate
42544254

42554255
```php
42564256
$lazyCollection = LazyCollection::times(INF)
4257-
->takeUntilTimeout(now()->addMinute());
4257+
->takeUntilTimeout(now()->plus(minutes: 1));
42584258

42594259
$lazyCollection->each(function (int $number) {
42604260
dump($number);

eloquent-relationships.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,7 @@ Of course, like calls to the query builder's `where` method, you may also specif
16751675

16761676
```php
16771677
$posts = Post::whereRelation(
1678-
'comments', 'created_at', '>=', now()->subHour()
1678+
'comments', 'created_at', '>=', now()->minus(hours: 1)
16791679
)->get();
16801680
```
16811681

eloquent.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@ class Flight extends Model
12321232
*/
12331233
public function prunable(): Builder
12341234
{
1235-
return static::where('created_at', '<=', now()->subMonth());
1235+
return static::where('created_at', '<=', now()->minus(months: 1));
12361236
}
12371237
}
12381238
```
@@ -1305,7 +1305,7 @@ class Flight extends Model
13051305
*/
13061306
public function prunable(): Builder
13071307
{
1308-
return static::where('created_at', '<=', now()->subMonth());
1308+
return static::where('created_at', '<=', now()->minus(months: 1));
13091309
}
13101310
}
13111311
```
@@ -1387,7 +1387,7 @@ class AncientScope implements Scope
13871387
*/
13881388
public function apply(Builder $builder, Model $model): void
13891389
{
1390-
$builder->where('created_at', '<', now()->subYears(2000));
1390+
$builder->where('created_at', '<', now()->minus(years: 2000));
13911391
}
13921392
}
13931393
```
@@ -1464,7 +1464,7 @@ class User extends Model
14641464
protected static function booted(): void
14651465
{
14661466
static::addGlobalScope('ancient', function (Builder $builder) {
1467-
$builder->where('created_at', '<', now()->subYears(2000));
1467+
$builder->where('created_at', '<', now()->minus(years: 2000));
14681468
});
14691469
}
14701470
}

events.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Like queued jobs, you may use the `onConnection`, `onQueue`, and `delay` methods
186186
```php
187187
Event::listen(queueable(function (PodcastProcessed $event) {
188188
// ...
189-
})->onConnection('redis')->onQueue('podcasts')->delay(now()->addSeconds(10)));
189+
})->onConnection('redis')->onQueue('podcasts')->delay(now()->plus(seconds: 10)));
190190
```
191191

192192
If you would like to handle anonymous queued listener failures, you may provide a closure to the `catch` method while defining the `queueable` listener. This closure will receive the event instance and the `Throwable` instance that caused the listener's failure:
@@ -590,7 +590,7 @@ use DateTime;
590590
*/
591591
public function retryUntil(): DateTime
592592
{
593-
return now()->addMinutes(5);
593+
return now()->plus(minutes: 5);
594594
}
595595
```
596596

filesystem.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ Using the `temporaryUrl` method, you may create temporary URLs to files stored u
348348
use Illuminate\Support\Facades\Storage;
349349

350350
$url = Storage::temporaryUrl(
351-
'file.jpg', now()->addMinutes(5)
351+
'file.jpg', now()->plus(minutes: 5)
352352
);
353353
```
354354

@@ -374,7 +374,7 @@ If you need to specify additional [S3 request parameters](https://docs.aws.amazo
374374
```php
375375
$url = Storage::temporaryUrl(
376376
'file.jpg',
377-
now()->addMinutes(5),
377+
now()->plus(minutes: 5),
378378
[
379379
'ResponseContentType' => 'application/octet-stream',
380380
'ResponseContentDisposition' => 'attachment; filename=file2.jpg',
@@ -429,7 +429,7 @@ If you need to generate a temporary URL that can be used to upload a file direct
429429
use Illuminate\Support\Facades\Storage;
430430

431431
['url' => $url, 'headers' => $headers] = Storage::temporaryUploadUrl(
432-
'file.jpg', now()->addMinutes(5)
432+
'file.jpg', now()->plus(minutes: 5)
433433
);
434434
```
435435

helpers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,7 +2407,7 @@ You may add items to the cache by passing an array of key / value pairs to the f
24072407
```php
24082408
cache(['key' => 'value'], 300);
24092409

2410-
cache(['key' => 'value'], now()->addSeconds(10));
2410+
cache(['key' => 'value'], now()->plus(seconds: 10));
24112411
```
24122412

24132413
<a name="method-class-uses-recursive"></a>
@@ -3466,7 +3466,7 @@ Sleep::for(500)->milliseconds();
34663466
Sleep::for(5000)->microseconds();
34673467

34683468
// Pause execution until a given time...
3469-
Sleep::until(now()->addMinute());
3469+
Sleep::until(now()->plus(minutes: 1));
34703470

34713471
// Alias of PHP's native "sleep" function...
34723472
Sleep::sleep(2);
@@ -3638,7 +3638,7 @@ $uri = Uri::of('https://example.com/path');
36383638
$uri = Uri::to('/dashboard');
36393639
$uri = Uri::route('users.show', ['user' => 1]);
36403640
$uri = Uri::signedRoute('users.show', ['user' => 1]);
3641-
$uri = Uri::temporarySignedRoute('user.index', now()->addMinutes(5));
3641+
$uri = Uri::temporarySignedRoute('user.index', now()->plus(minutes: 5));
36423642
$uri = Uri::action([UserController::class, 'index']);
36433643
$uri = Uri::action(InvokableController::class);
36443644

0 commit comments

Comments
 (0)