Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0659a04

Browse files
authoredApr 10, 2025
Updated README, Bumped up the version, Updated post install script.
Update README webhook configuration tutorial link. Bumped Up chargebee/cashier version. Updated post install script to append port value at the end of .env file.
2 parents 273c63c + b7abddc commit 0659a04

File tree

2 files changed

+54
-20
lines changed

2 files changed

+54
-20
lines changed
 

‎README.md

Lines changed: 52 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,62 @@
11
# Laravel Starter Kit for Billing with Chargebee Cashier
22

3-
Quickly set up billing in your Laravel app using Chargebee.
3+
Quickly set up billing in your Laravel application using Chargebee.
4+
5+
## Getting Started
6+
7+
### Installation
48

5-
## Installation
69
Run the following command in your terminal:
10+
711
```sh
8-
laravel new --using=chargebee/react-starter-kit
9-
```
12+
laravel new --using=chargebee/laravel-react-starter-kit
13+
```
14+
1015
Then, navigate to your project folder:
16+
1117
```sh
1218
cd your-project-name
13-
```
19+
```
20+
21+
### Environment Configuration
1422

15-
## Setup
1623
- Fill in the Chargebee-related `.env` variables (see `.env.example`).
17-
- ⚠️ **Run the server on port `8080` or `8443` for Chargebee checkout to work.**
18-
- Fetch your plans from Chargebee:
19-
```sh
20-
php artisan chargebee:fetch-plans
21-
```
22-
- Set up a webhook using **ngrok** or **Cloudflare Tunnel**. If ngrok gives you a URL like `https://{abc}.ngrok-free.app`, set your webhook URL as:
23-
🔗 `https://{abc}.ngrok-free.app/chargebee/webhook`
24-
Add this in your Chargebee dashboard.
25-
- Start the server:
26-
```sh
27-
php artisan serve
28-
```
24+
- ⚠️ **Important**: Run the server on port `8080` or `8443` for Chargebee checkout to work. You can do this by adding`SERVER_PORT=8080` in .env file.
25+
26+
## Initial Setup
27+
28+
### Synchronizing Plans
29+
30+
Fetch your plans from Chargebee:
31+
32+
```sh
33+
php artisan chargebee:fetch-plans
34+
```
35+
36+
### Webhook Configuration
37+
38+
Set up a webhook using either of these options:
39+
40+
#### Using Ngrok
41+
42+
Here is a [short tutorial on getting started with Ngrok](https://ngrok.com/docs/getting-started/).
43+
44+
If ngrok gives you a URL like `https://{abc}.ngrok-free.app`, set your webhook URL as:
45+
🔗 `https://{abc}.ngrok-free.app/chargebee/webhook`
46+
47+
#### Using Cloudflare Tunnel
48+
49+
Here is a short tutorial on [how to configure tunnel on Cloudflare to test webhook](https://medium.com/@agmmnn/test-your-webhooks-with-cloudflare-tunnel-quickly-5875f74024b4).
50+
51+
If Cloudflare Tunnel gives you a URL like `https://{your-tunnel-name}.trycloudflare.com`, set your webhook URL as:
52+
🔗 `https://{your-tunnel-name}.trycloudflare.com/chargebee/webhook`
53+
54+
> **Note:** Don't forget to [add this webhook URL](https://www.chargebee.com/docs/2.0/webhook_settings.html) in your Chargebee dashboard.
55+
56+
## Running Your Application
57+
58+
Start the application using:
59+
60+
```sh
61+
composer run dev
62+
```

‎composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"license": "MIT",
1111
"require": {
1212
"php": "^8.2",
13-
"chargebee/cashier": "v1.0.0.0-beta.1",
13+
"chargebee/cashier": "v1.0.0-beta.2",
1414
"dompdf/dompdf": "^3.1",
1515
"inertiajs/inertia-laravel": "^2.0",
1616
"laravel/framework": "^12.0",
@@ -48,7 +48,7 @@
4848
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
4949
],
5050
"post-root-package-install": [
51-
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
51+
"@php -r \"if (!file_exists('.env')) { copy('.env.example', '.env'); file_put_contents('.env', PHP_EOL . 'SERVER_PORT=8080', FILE_APPEND); }\""
5252
],
5353
"post-create-project-cmd": [
5454
"@php artisan key:generate --ansi",

0 commit comments

Comments
 (0)
Please sign in to comment.