Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the Cashier (Paddle) documentation #10135

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cashier-paddle.md: Clarify differences between the user's and subscri…
…ption's onTrial methods
carlosmintfan authored Feb 15, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit e3875d079620189c1def88f1f2a42993dd8c4702
4 changes: 2 additions & 2 deletions cashier-paddle.md
Original file line number Diff line number Diff line change
@@ -1092,13 +1092,13 @@ When your application receives the `subscription_created` event, Cashier will se
> [!WARNING]
> 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.

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:
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. However, please note that the `->subscription()` method will return `null` if the user doesn't have a subscription and only the `onTrial` method of the user, not the one of the subscription will return `true` if the user is on a [generic trial](#without-payment-method-up-front).

if ($user->onTrial()) {
// ...
}

if ($user->subscription()->onTrial()) {
if ($user->subscription()?->onTrial()) {
// ...
}
To determine if an existing trial has expired, you may use the `hasExpiredTrial` methods: