You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -33,7 +33,7 @@ Leaf's billing system helps makers move faster by handling payments and subscrip
33
33
34
34
To get started, create a Stripe account and grab your API keys. Then, drop them into your `.env` file:
35
35
36
-
```env:no-line-numbers [Stripe]
36
+
```env [Stripe]
37
37
BILLING_PROVIDER=stripe
38
38
STRIPE_API_KEY=sk_test_XXXX
39
39
STRIPE_PUBLISHABLE_KEY=pk_test_XXXX
@@ -50,7 +50,7 @@ leaf install stripe
50
50
51
51
Billing on-the-fly is the fastest way to charge customers—ideal for one-time payments, donations, or services. Just generate a payment link with Leaf Billing, and we’ll handle the rest. You can do this using the `billing()` helper in your controller.
52
52
53
-
```php:no-line-numbers [MyController.php]
53
+
```php
54
54
...
55
55
56
56
public function handleCartPurchase($cartId) {
@@ -110,13 +110,13 @@ class CallbacksController extends Controller
110
110
111
111
Unlike one-time payments, subscriptions require a more structured setup—but Leaf Billing makes it effortless. Just run the `scaffold:subscriptions` command to instantly generate everything you need: billing config, controllers, routes, and views. You'll be up and running with subscriptions in minutes.
112
112
113
-
```bash:no-line-numbers
113
+
```bash
114
114
php leaf scaffold:subscriptions
115
115
```
116
116
117
117
You then need to update the generated `config/billing.php` file with your subscription tiers under the `tiers` key:
118
118
119
-
```php:no-line-numbers [billing.php]
119
+
```php
120
120
...
121
121
'tiers' => [
122
122
[
@@ -177,19 +177,19 @@ You then need to update the generated `config/billing.php` file with your subscr
177
177
178
178
The `scaffold:subscriptions` command also generates a pricing component tailored to your chosen view engine—Blade, React, Vue, or Svelte. You can display your plans with just one line of code. The component is fully customizable, so you can tweak the design to match your app’s look and feel seamlessly.
179
179
180
-
```blade:no-line-numbers [Blade]
180
+
```blade [Blade]
181
181
@component('components.billing.pricing')
182
182
```
183
183
184
-
```jsx:no-line-numbers [React]
184
+
```jsx [React]
185
185
importPricingfrom'@/components/billing/pricing';
186
186
187
187
...
188
188
189
189
<Pricing />
190
190
```
191
191
192
-
```vue:no-line-numbers [Vue]
192
+
```vue [Vue]
193
193
<script setup>
194
194
import Pricing from '@/components/billing/pricing.vue';
195
195
@@ -201,7 +201,7 @@ import Pricing from '@/components/billing/pricing.vue';
201
201
</template>
202
202
```
203
203
204
-
```svelte:no-line-numbers [Svelte]
204
+
```svelte [Svelte]
205
205
<script>
206
206
import Pricing from '@/components/billing/pricing.svelte';
207
207
</script>
@@ -213,7 +213,7 @@ import Pricing from '@/components/billing/pricing.svelte';
213
213
214
214
Once you’ve charged a customer—especially for a subscription—you’ll want to track their payment status. The best way to do this is through webhooks. When you run the `scaffold:subscriptions` command, Leaf Billing automatically generates a webhook controller that listens for events from your billing provider and handles them for you.
0 commit comments