https://github.com/randomstate/mint
Boilerplate billing integration for Laravel SaaS apps.
https://github.com/randomstate/mint
Last synced: 12 months ago
JSON representation
Boilerplate billing integration for Laravel SaaS apps.
- Host: GitHub
- URL: https://github.com/randomstate/mint
- Owner: randomstate
- Created: 2020-02-21T17:20:01.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-02T11:15:20.000Z (about 3 years ago)
- Last Synced: 2025-02-05T16:22:44.799Z (about 1 year ago)
- Language: PHP
- Size: 226 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Introduction
## Installation
Require the library using composer:
```
composer require randomstate/mint
```
## Database Migrations
Mint provides migrations for the models it uses out of the box. These are automatically registered
with laravel. You will need to run `php artisan migrate` to initialize these tables.
The library assumes your application uses a `users` table that should contain the Stripe customer ID.
If you need to customize this, please publish the migrations first.
```
php artisan vendor:publish
```
## Configuration
### Billable Model
Add the Mint Billable trait to your User model. This will give it access to the fluent interface Mint
provides on each customer. If you are charging organisations or teams, publish & customize the customer
migration to point to the appropriate table, and add the Billable trait to your org/team model.
```php
use RandomState\Mint\Mint\Billable;
class User extends Authenticatable
{
use Billable;
}
```
### API Keys
Add your Stripe API Keys to your .env file:
```dotenv
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
```