:install
:
.env
file.
order.created
order.updated
subscription.created
subscription.updated
subscription.active
subscription.canceled
subscription.revoked
benefit_grant.created
benefit_grant.updated
benefit_grant.revoked
@polarEmbedScript
directive to include the script in your views inside the <head>
tag.
App\Http\Middleware\VerifyCsrfToken
middleware:
polar/*
in your application’s bootstrap/app.php
file:
Command | Description |
---|---|
php artisan polar:products | List all available products with their ids |
checkout
method.
[!NOTE]
If you are requesting the checkout a lot of times we recommend you to cache the URL returned by the checkout
method.
charge
method.
Billable
trait.
withSuccessUrl
method:
checkout_id={CHECKOUT_ID}
query parameter to the URL to retrieve the checkout session id:
withMetadata
method:
withCustomerMetadata
method:
billable_id
billable_type
subscription_type
redirectToCustomerPortal()
method on your billable model (e.g., the User model).
orders
relationship on the billable model:
status
attribute:
Order
model:
SubscriptionCreated
event webhook connects it to your billable model in the database. You may then get the subscription from your billable model:
valid
method:
onGracePeriod
check.
swap
method:
swapAndInvoice
method instead.
cancel
method.
onGracePeriod
method:
[!NOTE] Coming soon.
Danestves\LaravelPolar\Events\BenefitGrantCreated
Danestves\LaravelPolar\Events\BenefitGrantUpdated
Danestves\LaravelPolar\Events\BenefitGrantRevoked
Danestves\LaravelPolar\Events\OrderCreated
Danestves\LaravelPolar\Events\OrderRefunded
Danestves\LaravelPolar\Events\SubscriptionActive
Danestves\LaravelPolar\Events\SubscriptionCanceled
Danestves\LaravelPolar\Events\SubscriptionCreated
Danestves\LaravelPolar\Events\SubscriptionRevoked
Danestves\LaravelPolar\Events\SubscriptionUpdated
$model
object and an event $payload
. The subscription events also include the $subscription
object. These can be accessed via the public properties.
If you wish to respond to these events, you must establish listeners for them. For example, you may wish to react when a subscription is updated.
EventServiceProvider
: