Skip to content

Commit 82f5b38

Browse files
committed
update trial docs
1 parent 68c1d75 commit 82f5b38

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

Diff for: cashier-paddle.md

+3-11
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ To create a subscription, first retrieve an instance of your billable model from
748748
use Illuminate\Http\Request;
749749

750750
Route::get('/user/subscribe', function (Request $request) {
751-
$checkout = $request->user()->subscribe($premium = 12345, 'default')
751+
$checkout = $request->user()->subscribe($premium = 'pri_123', 'default')
752752
->returnTo(route('home'));
753753

754754
return view('billing', ['checkout' => $checkout]);
@@ -760,7 +760,7 @@ The first argument given to the `subscribe` method is the specific price the use
760760
You may also provide an array of custom metadata regarding the subscription using the `customData` method:
761761

762762
```php
763-
$checkout = $request->user()->subscribe($premium = 12345, 'default')
763+
$checkout = $request->user()->subscribe($premium = 'pri_123', 'default')
764764
->customData(['key' => 'value'])
765765
->returnTo(route('home'));
766766
```
@@ -1235,16 +1235,12 @@ When your application receives the `subscription_created` event, Cashier will se
12351235
> [!WARNING]
12361236
> If the customer's subscription is not canceled before the trial ending date they will be charged as soon as the trial expires, so you should be sure to notify your users of their trial ending date.
12371237
1238-
You may determine if the 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:
1238+
You may determine if the user is within their trial period using either the `onTrial` method of the user instance:
12391239

12401240
```php
12411241
if ($user->onTrial()) {
12421242
// ...
12431243
}
1244-
1245-
if ($user->subscription()->onTrial()) {
1246-
// ...
1247-
}
12481244
```
12491245

12501246
To determine if an existing trial has expired, you may use the `hasExpiredTrial` methods:
@@ -1253,10 +1249,6 @@ To determine if an existing trial has expired, you may use the `hasExpiredTrial`
12531249
if ($user->hasExpiredTrial()) {
12541250
// ...
12551251
}
1256-
1257-
if ($user->subscription()->hasExpiredTrial()) {
1258-
// ...
1259-
}
12601252
```
12611253

12621254
To determine if a user is on trial for a specific subscription type, you may provide the type to the `onTrial` or `hasExpiredTrial` methods:

0 commit comments

Comments
 (0)