Benefits are automated features that Polar grants to customers when they purchase a product. Instead of writing custom webhook logic for every perk you offer, you define benefits once in Polar and let the platform handle delivery. TheDocumentation Index
Fetch the complete documentation index at: https://danestvesllc-2b77d201.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
LaravelPolar facade covers the full lifecycle: create, update, delete, list, and fetch. Your Billable model also exposes helpers for listing benefits and their grants per customer.
Benefits vs. features: A “benefit” is a Polar concept — it’s the mechanism that delivers a feature (like a Discord role or a license key) to a customer after purchase. You react to benefit grant/revoke events with Laravel listeners.
Benefit types
Polar supports six built-in benefit types:| Type | Class | Description |
|---|---|---|
| Custom | BenefitCustomCreate | Any ad-hoc benefit you describe in text |
| Discord | BenefitDiscordCreate | Automatic Discord role assignment |
| GitHub Repository | BenefitGitHubRepositoryCreate | Grant access to a private GitHub repository |
| Downloadables | BenefitDownloadablesCreate | Files customers can download after purchase |
| License Keys | BenefitLicenseKeysCreate | Issue license keys on purchase |
| Meter Credit | BenefitMeterCreditCreate | Award usage-meter credits on purchase |
Creating a benefit
Pass one of the six create classes toLaravelPolar::createBenefit(). The example below creates a custom benefit, but the same pattern applies to all types.
Updating a benefit
*Update class — e.g. BenefitDiscordUpdate, BenefitGitHubRepositoryUpdate, and so on.
Deleting a benefit
Listing and fetching benefits
Billable model helpers
TheBillable trait adds three convenience methods to your model:
listBenefits() and listBenefitGrants() return the full Operations\BenefitsListResponse and Operations\BenefitsGrantsResponse respectively, giving you access to pagination metadata alongside the items.
Webhook events
Laravel Polar dispatches three typed events when a benefit grant changes state. Register listeners for them in yourEventServiceProvider (or let Laravel’s auto-discovery find them):
| Event | Triggered when |
|---|---|
BenefitGrantCreated | A benefit is granted after a successful purchase |
BenefitGrantUpdated | An existing grant is modified |
BenefitGrantRevoked | A grant is removed (e.g. subscription cancelled) |
$billable convenience property pointing to the associated billable model, plus a $payload containing the full webhook payload.