Laravel Polar automatically records orders whenever 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.
order.created webhook fires. The Billable trait exposes these records as an Eloquent relationship, so you can query, filter, and display order history with the same patterns you use everywhere else in Laravel.
Orders are created automatically by the webhook handler — you never need to create them manually. Each
Order model maps 1:1 to a Polar order and is linked to the billable model that initiated the checkout.Accessing orders
Call$user->orders to retrieve all orders belonging to a billable model. Results are returned ordered by date descending — newest first.
Danestves\LaravelPolar\Order.
Order attributes
TheOrder model exposes the following attributes. Monetary values are always stored in minor units (cents for USD) — divide by 100 before displaying to customers.
| Attribute | Type | Description | |
|---|---|---|---|
polar_id | `string | null` | The Polar order ID |
status | OrderStatus | Current status enum value | |
amount | int | Total charged, in minor units (e.g. cents) | |
tax_amount | int | Tax portion, in minor units | |
refunded_amount | int | Amount refunded so far, in minor units | |
refunded_tax_amount | int | Tax portion of any refunds, in minor units | |
currency | string | ISO 4217 currency code, e.g. "usd" | |
ordered_at | Carbon | When the order was placed | |
refunded_at | `Carbon | null` | When the order was fully refunded, if applicable |
Checking order status
Use the boolean helper methods to check the current state of an order instead of comparing thestatus attribute directly.
refunded_at timestamp is set when the order moves to fully refunded status. You can use it to display the refund date to customers:
partiallyRefunded() returns true when some amount has been refunded but the order is not fully refunded. An order can move from partiallyRefunded to refunded if subsequent refunds cover the remaining balance.Checking for a specific product
To determine whether a particular order is for a given product, usehasProduct():
hasPurchasedProduct() on the billable model:
hasPurchasedProduct() checks the customer’s order history for a completed purchase matching the given product ID, so it only returns true for paid orders.
Displaying order history in a Blade view
Pass the user’s orders to your view and render them in a table:Amounts are stored in minor units (cents for USD). Divide by
100 before displaying them to customers.