> ## Documentation Index
> Fetch the complete documentation index at: https://docs.larafast.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Paddle

> Paddle Integration in Larafast

### Connect Paddle to Project

To get started with Paddle, install Laravel Cashier Paddle package by running following command

```
composer require laravel/cashier-paddle
```

During local and staging development, you should [register a Paddle Sandbox account](https://sandbox-login.paddle.com/signup). This account will give you a sandboxed environment to test and develop your applications without making actual payments. You may use Paddle's [test card numbers](https://developer.paddle.com/concepts/payment-methods/credit-debit-card) to simulate various payment scenarios.

When using the Paddle Sandbox environment, you should set the `PADDLE_SANDBOX` environment variable to `true` within your application's `.env` file:

```dotenv .env theme={null}
PADDLE_SANDBOX=true
```

After you have finished developing your application you may [apply for a Paddle vendor account](https://paddle.com/). Before your application is placed into production, Paddle will need to approve your application's domain.

### Set API Keys

To create Client Side Token and API Key go to -> [https://sandbox-vendors.paddle.com/authentication-v2](https://sandbox-vendors.paddle.com/authentication-v2)

```dotenv .env theme={null}
PADDLE_CLIENT_SIDE_TOKEN=test_a9327e5cb0d4414c94f4011d065
PADDLE_API_KEY=3d6bd06df7a5715ca10a0caf8ef29d6802d11605cdf8ec82b0
PADDLE_RETAIN_KEY=your-paddle-retain-key
PADDLE_WEBHOOK_SECRET="your-paddle-webhook-secret"
PADDLE_SANDBOX=true
```

### Migrations

Next, you should publish the Cashier migration files using the `vendor:publish` Artisan command:

```bash theme={null}
php artisan vendor:publish --tag="cashier-migrations"
```

Then, you should run your application's database migrations. The Cashier migrations will create a new `customers` table. In addition, new `subscriptions` and `subscription_items` tables will be created to store all of your customer's subscriptions. Lastly, a new `transactions` table will be created to store all of the Paddle transactions associated with your customers:

```bash theme={null}
php artisan migrate
```

<Tip>
  For more details on initial setup and webhooks see official Laravel doc for Paddle -> [https://laravel.com/docs/11.x/cashier-paddle#introduction](https://laravel.com/docs/11.x/cashier-paddle#introduction)
</Tip>

### Components

Paddle Payment is handled inside `app/Http/Controllers/Payments/PaddleController.php` file

Vue component located in \`resources/js/Components/Paddle/PaddlePlans.vue
