You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1309,12 +1309,12 @@ Of course, you may also cancel the subscription entirely:
1309
1309
1310
1310
$user->subscription('swimming')->cancel();
1311
1311
1312
-
<aname="metered-billing"></a>
1313
-
### Metered Billing
1312
+
<aname="usage-based-billing"></a>
1313
+
### Usage Based Billing
1314
1314
1315
-
[Metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) allows you to charge customers based on their product usage during a billing cycle. For example, you may charge customers based on the number of text messages or emails they send per month.
1315
+
[Usage based billing](https://stripe.com/docs/billing/subscriptions/metered-billing) allows you to charge customers based on their product usage during a billing cycle. For example, you may charge customers based on the number of text messages or emails they send per month.
1316
1316
1317
-
To start using metered billing, you will first need to create a new product in your Stripe dashboard with a metered price. Then, use the `meteredPrice` to add the metered price ID to a customer subscription:
1317
+
To start using usage billing, you will first need to create a new product in your Stripe dashboard with a [usage based billing model](https://docs.stripe.com/billing/subscriptions/usage-based/implementation-guide) and a [meter](https://docs.stripe.com/billing/subscriptions/usage-based/recording-usage#configure-meter). After creating the meter, store the associated event name and meter ID, which you will need to report and retrieve usage. Then, use the `meteredPrice` method to add the metered price ID to a customer subscription:
1318
1318
1319
1319
use Illuminate\Http\Request;
1320
1320
@@ -1340,54 +1340,33 @@ You may also start a metered subscription via [Stripe Checkout](#checkout):
1340
1340
<aname="reporting-usage"></a>
1341
1341
#### Reporting Usage
1342
1342
1343
-
As your customer uses your application, you will report their usage to Stripe so that they can be billed accurately. To increment the usage of a metered subscription, you may use the `reportUsage` method:
1343
+
As your customer uses your application, you will report their usage to Stripe so that they can be billed accurately. To report the usage of a metered event, you may use the `reportMeterEvent` method on your `Billable` model:
1344
1344
1345
1345
$user = User::find(1);
1346
1346
1347
-
$user->subscription('default')->reportUsage();
1347
+
$user->reportMeterEvent('emails-sent');
1348
1348
1349
1349
By default, a "usage quantity" of 1 is added to the billing period. Alternatively, you may pass a specific amount of "usage" to add to the customer's usage for the billing period:
If your application offers multiple prices on a single subscription, you will need to use the `reportUsageFor` method to specify the metered price you want to report usage for:
1355
+
To retrieve a customer's event summary for a meter, you may use a `Billable` instance's `meterEventSummaries` method:
Sometimes, you may need to update usage which you have previously reported. To accomplish this, you may pass a timestamp or a `DateTimeInterface` instance as the second parameter to `reportUsage`. When doing so, Stripe will update the usage that was reported at that given time. You can continue to update previous usage records as the given date and time is still within the current billing period:
Please refer to Stripe's [Meter Event Summary object documentation](https://docs.stripe.com/api/billing/meter-event_summary/object) for more information on meter event summaries.
1375
1364
1376
-
If your application offers multiple prices on a single subscription, you may use the `usageRecordsFor` method to specify the metered price that you wish to retrieve usage records for:
1365
+
To [list all meters](https://docs.stripe.com/api/billing/meter/list), you may use a `Billable` instance's `meters` method:
The `usageRecords` and `usageRecordsFor` methods return a Collection instance containing an associative array of usage records. You may iterate over this array to display a customer's total usage:
1383
-
1384
-
@foreach ($usageRecords as $usageRecord)
1385
-
- Period Starting: {{ $usageRecord['period']['start'] }}
1386
-
- Period Ending: {{ $usageRecord['period']['end'] }}
1387
-
- Total Usage: {{ $usageRecord['total_usage'] }}
1388
-
@endforeach
1389
-
1390
-
For a full reference of all usage data returned and how to use Stripe's cursor based pagination, please consult [the official Stripe API documentation](https://stripe.com/docs/api/usage_records/subscription_item_summary_list).
Copy file name to clipboardExpand all lines: original-en/filesystem.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ When using the `local` driver, all file operations are relative to the `root` di
54
54
55
55
The `public` disk included in your application's `filesystems` configuration file is intended for files that are going to be publicly accessible. By default, the `public` disk uses the `local` driver and stores its files in `storage/app/public`.
56
56
57
-
To make these files accessible from the web, you should create a symbolic link from `public/storage` to`storage/app/public`. Utilizing this folder convention will keep your publicly accessible files in one directory that can be easily shared across deployments when using zero down-time deployment systems like [Envoyer](https://envoyer.io).
57
+
To make these files accessible from the web, you should create a symbolic link from source directory`storage/app/public` to target directory `public/storage`. Utilizing this folder convention will keep your publicly accessible files in one directory that can be easily shared across deployments when using zero down-time deployment systems like [Envoyer](https://envoyer.io).
58
58
59
59
To create the symbolic link, you may use the `storage:link` Artisan command:
Copy file name to clipboardExpand all lines: original-en/http-client.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -337,6 +337,16 @@ If you would like to perform some additional logic before the exception is throw
337
337
// ...
338
338
})->json();
339
339
340
+
By default, `RequestException` messages are truncated to 120 characters when logged or reported. To customize or disable this behavior, you may utilize the `truncateRequestExceptionsAt` and `dontTruncateRequestExceptions` methods when configuring your application's exception handling behavior in your `bootstrap/app.php` file:
Copy file name to clipboardExpand all lines: original-en/installation.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,16 +66,16 @@ Before creating your first Laravel application, make sure that your local machin
66
66
If you don't have PHP and Composer installed on your local machine, the following commands will install PHP, Composer, and the Laravel installer on macOS, Windows, or Linux:
After running one of the commands above, you should restart your terminal session. To update PHP, Composer, and the Laravel installer after installing them via `php.new`, you can re-run the command in your terminal.
Laravel Sail's Docker configuration includes support for [Xdebug](https://xdebug.org/), a popular and powerful debugger for PHP. In order to enable Xdebug, you will need to add a few variables to your application's `.env` file to [configure Xdebug](https://xdebug.org/docs/step_debug#mode). To enable Xdebug you must set the appropriate mode(s) before starting Sail:
499
+
Laravel Sail's Docker configuration includes support for [Xdebug](https://xdebug.org/), a popular and powerful debugger for PHP. To enable Xdebug, ensure you have [published your Sail configuration](#sail-customization). Then, add the following variables to your application's `.env` file to configure Xdebug:
500
500
501
501
```ini
502
502
SAIL_XDEBUG_MODE=develop,debug,coverage
503
503
```
504
504
505
+
Next, ensure that your published `php.ini` file includes the following configuration so that Xdebug is activated in the specified modes:
506
+
507
+
```ini
508
+
[xdebug]
509
+
xdebug.mode=${XDEBUG_MODE}
510
+
```
511
+
512
+
After modifying the `php.ini` file, remember to rebuild your Docker images so that your changes to the `php.ini` file take effect:
513
+
514
+
```shell
515
+
sail build --no-cache
516
+
```
517
+
505
518
#### Linux Host IP Configuration
506
519
507
520
Internally, the `XDEBUG_CONFIG` environment variable is defined as `client_host=host.docker.internal` so that Xdebug will be properly configured for Mac and Windows (WSL2). If your local machine is running Linux and you're using Docker 20.10+, `host.docker.internal` is available, and no manual configuration is required.
Copy file name to clipboardExpand all lines: original-en/scheduling.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -519,19 +519,24 @@ Using the `pingBefore` and `thenPing` methods, the scheduler can automatically p
519
519
->pingBefore($url)
520
520
->thenPing($url);
521
521
522
-
The `pingBeforeIf` and `thenPingIf` methods may be used to ping a given URL only if a given condition is `true`:
522
+
The `pingOnSuccess` and `pingOnFailure` methods may be used to ping a given URL only if the task succeeds or fails. A failure indicates that the scheduled Artisan or system command terminated with a non-zero exit code:
523
523
524
524
Schedule::command('emails:send')
525
525
->daily()
526
-
->pingBeforeIf($condition, $url)
527
-
->thenPingIf($condition, $url);
526
+
->pingOnSuccess($successUrl)
527
+
->pingOnFailure($failureUrl);
528
528
529
-
The `pingOnSuccess` and `pingOnFailure` methods may be used to ping a given URL only if the task succeeds or fails. A failure indicates that the scheduled Artisan or system command terminated with a non-zero exit code:
529
+
The `pingBeforeIf`,`thenPingIf`,`pingOnSuccessIf`, and `pingOnFailureIf` methods may be used to ping a given URL only if a given condition is `true`:
0 commit comments