Skip to content

Commit

Permalink
First pass at converting docs to Mintlify
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrooksuk committed Nov 13, 2024
0 parents commit e85521a
Show file tree
Hide file tree
Showing 29 changed files with 2,028 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Mintlify Starter Kit

Click on `Use this template` to copy the Mintlify starter kit. The starter kit contains examples including

- Guide pages
- Navigation
- Customizations
- API Reference pages
- Use of popular components

### Development

Install the [Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the documentation changes locally. To install, use the following command

```
npm i -g mintlify
```

Run the following command at the root of your documentation (where mint.json is)

```
mintlify dev
```

### Publishing Changes

Install our Github App to auto propagate changes from your repo to your deployment. Changes will be deployed to production automatically after pushing to the default branch. Find the link to install on your dashboard.

#### Troubleshooting

- Mintlify dev isn't running - Run `mintlify install` it'll re-install dependencies.
- Page loads as a 404 - Make sure you are running in a folder with `mint.json`
14 changes: 14 additions & 0 deletions customization.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: 'Customization'
description: 'Learn how to customize Spark.'
---

## Custom Information Messages

When redirecting to your application's billing portal, you may provide an optional, informational message to give the user context regarding why they are being redirected to the portal. For example, you may provide a message indicating that their subscription has expired.

To provide a message, simply provide a `message` query string parameter to the billing portal. The provided message will appear at the top of your application's billing portal:

```
http://localhost/billing?message=Hello+World
```
Binary file added favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions helpscout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
! function(e, t, n) {
function a() {
var e = t.getElementsByTagName("script")[0],
n = t.createElement("script");
n.type = "text/javascript", n.async = !0, n.src = "https://beacon-v2.helpscout.net", e.parentNode.insertBefore(n, e)
}
if (e.Beacon = n = function(t, n, a) {
e.Beacon.readyQueue.push({
method: t,
options: n,
data: a
})
}, n.readyQueue = [], "complete" === t.readyState) return a();
e.attachEvent ? e.attachEvent("onload", a) : e.addEventListener("load", a, !1)

window.Beacon('init', 'b4c28295-5588-4668-a3af-7a56a9091998')

document.querySelector("#navbar ul a[href='mailto:[email protected]']").onclick = function (e) {
if (typeof window.Beacon !== 'undefined') {
e.preventDefault();
Beacon('open')
}
}
}(window, document, window.Beacon || function() {});
Binary file added images/disabled-features.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/incentive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 102 additions & 0 deletions installation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
title: 'Installation'
description: 'An introduction to Laravel Spark.'
---

## Installing Spark via Composer

<Note>
Before installing Spark, you will need to purchase a [Spark license](https://spark.laravel.com/licenses). You can purchase a Spark license via the Spark dashboard.
</Note>

To get started installing Spark, add the Spark repository to your application's `composer.json` file:

```json composer.json
"repositories": [
{
"type": "composer",
"url": "https://spark.laravel.com"
}
],
```

Next, you may add the `laravel/spark-paddle` or `laravel/spark-stripe` package to the list of required packages in your `composer.json` file:

```json composer.json
"require": {
"php": "^8.2",
"laravel/framework": "^11.0",
"laravel/spark-paddle": "^5.0"
},
```

After your `composer.json` file has been updated, run the `composer update` command in your console terminal:

```bash
composer update
```

When running `composer update`, you will be prompted to provide your login credentials for the Spark website. These credentials will authenticate your Composer session as having permission to download the Spark source code. To avoid manually typing these credentials, you may create a [Composer auth.json file](https://getcomposer.org/doc/articles/http-basic-authentication.md) and use your [API token](https://spark.laravel.com/user/api-tokens) in place of your password:

```json auth.json
{
"http-basic": {
"spark.laravel.com": {
"username": "[email protected]",
"password": "your-api-token"
}
}
}
```

You may quickly create an `auth.json` file via your terminal using the following command. As mentioned previously, you may create an API token via the [Spark dashboard](https://spark.laravel.com/user/api-tokens). This token may be used as a substitute for your password when creating a Composer `auth.json` file:

```bash
composer config http-basic.spark.laravel.com [email protected] your-api-token
```

<Note>

You should not commit your application's `auth.json` file into source control.
</Note>

Once the package is installed via Composer, run the `spark:install` Artisan command:

```bash
php artisan spark:install
```

Finally, run the `migrate` Artisan command:

```bash
php artisan migrate
```

<Note>

If you are using the Stripe edition of Spark and plan to bill a model other than the `App\Models\User` model, you should follow [these instructions](./spark-stripe/customization.md#migrations) before running the migration command.
</Note>

Lastly, you will need to configure Stripe or Paddle webhooks so that these services can communicate with your local application via webhooks. To get started, read our dedicated documentation on [Stripe webhooks](./spark-stripe/configuration.md#stripe-webhooks) or [Paddle webhooks](./spark-paddle/configuration.md#paddle-webhooks). Webhooks are required during both local development and in production environments.

That's it! Next, you may navigate to your application's `config/spark.php` configuration file and begin configuring your Spark installation.

## Authenticating Spark in Continuous Integration (CI) Environments

It's not advised to store your `auth.json` file inside your project's version control repository. However, there may be times you wish to download Spark inside a CI environment like [Chipper CI](https://chipperci.com/). For instance, you may wish to run tests for any custom tools you create. To authenticate Spark in these situations, you can use Composer to set the configuration option inside your CI system's pipeline, injecting environment variables containing the credentials you use to login to the Spark dashboard and a valid [Spark dashboard API token](https://spark.laravel.com/users/api-tokens):

```sh
composer config http-basic.spark.laravel.com ${SPARK_USERNAME} ${SPARK_API_TOKEN}
```

## Expired Licenses

If your Spark license has expired and you don't want to renew the license your `composer.json` file will need to specify the last version of Spark released before your license expired:

```json composer.json
"require": {
"php": "^8.2",
"laravel/framework": "^11.0",
"laravel/spark-paddle": "5.y.z"
},
```
52 changes: 52 additions & 0 deletions introduction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: 'Introduction'
description: 'An introduction to Laravel Spark.'
---

Laravel Spark is the perfect starting point for your next big idea. When combined with a Laravel application starter kit like [Laravel Jetstream](https://jetstream.laravel.com) or [Laravel Breeze](https://laravel.com/docs/starter-kits), or the frontend of your choice, Spark provides a well-designed billing management panel for your application. Spark, which is built on the power of [Laravel Cashier](https://laravel.com/docs/billing), allows your customers to subscribe to monthly or yearly billing plans, manage their payment method, update their subscription plans, and download their invoices all from a self-contained, beautifully designed billing portal.

<iframe width="600" height="337" src="https://www.youtube.com/embed/-wAmFagQSzI" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

## Supported Payment Providers

Spark supports two payment providers, and purchasing a Spark license grants you the ability to use either of these payment providers. **At this time, it is not possible to implement your own custom payment provider when using Spark.** We'll provide a brief overview of each provider below.

### Paddle

[Paddle](https://paddle.com) is a robust billing provider that serves as a merchant of record for your application. Paddle removes the burden of tax compliance from your SaaS business by handling the complexity of gathering and paying your VAT for you. In addition, Paddle provides support for accepting payments from your customers via credit card or PayPal, localized pricing, and hosted invoices.

Spark's Paddle support is provided by the underlying [Laravel Cashier Paddle](https://laravel.com/docs/cashier-paddle) library.

<Warning>
Your Paddle account must be approved by Paddle before you can begin using Spark. To apply for an account, please visit the [Paddle website](https://paddle.com). **While you are developing your application, you may use the [Paddle Sandbox](https://sandbox-vendors.paddle.com/)**.
</Warning>

### Stripe

[Stripe](https://stripe.com) is a global leader in payment infrastructure with direct integration with card networks and banks, a fast-improving platform, and battle-tested reliability. In addition, intelligent optimizations help increase revenue across conversion, prevent fraud, and assist with revenue recovery. Finally, Stripe provides a robust sandbox environment for you to test your application's payment system.

Spark's Stripe support is provided by the underlying [Laravel Cashier Stripe](https://laravel.com/docs/billing) library.

## Frequently Asked Questions

<AccordionGroup>
<Accordion title="Is it possible to upgrade an application from Spark Classic to Spark?">
No. However, we will continue to provide bug fixes and security updates to Spark Classic indefinitely.
</Accordion>

<Accordion title="Can I sell Spark powered applications?">
You may not sell Spark powered applications on code distribution platforms such as Code Canyon, etc. However, if you build a SaaS application / business which is later acquired by a private third-party, you may transfer your Spark license to that buyer.
</Accordion>

<Accordion title="Does Spark support any other payment providers?">
No. Spark only supports Stripe and Paddle and it is not possible for developers to customize Spark to accept additional providers. If you need to use another payment provider **you should not purchase Laravel Spark**.
</Accordion>

<Accordion title="Am I required to use Tailwind / Blade / Vue / etc. in order to use Spark?">
No. Spark's billing portal is totally isolated from the rest of your Laravel application and includes its own pre-compiled frontend assets. Your own application may be built using the frontend technologies of your choice.
</Accordion>

<Accordion title="Why are my customers presented with a payment confirmation screen?">
Extra verification is sometimes required in order to confirm and process a payment. When this happens, Paddle or Stripe will present a payment confirmation screen. Payment confirmation screens presented by Paddle, Stripe, or Spark may be tailored to a specific bank or card issuer's payment flow and can include additional card confirmation, a temporary small charge, separate device authentication, or other forms of verification.
</Accordion>
</AccordionGroup>
8 changes: 8 additions & 0 deletions logo/dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions logo/light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 94 additions & 0 deletions mint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"$schema": "https://mintlify.com/schema.json",
"name": "Laravel Spark",
"logo": {
"dark": "/logo/dark.svg",
"light": "/logo/light.svg"
},
"favicon": "/favicon.png",
"background": {
"style": "windows"
},
"colors": {
"primary": "#7C46F6",
"light": "#7C46F6",
"dark": "#7C46F6",
"anchors": {
"from": "#00E1FF",
"to": "#7C46F6"
}
},
"font": {
"headings": {
"family": "Figtree"
},
"body": {
"family": "Figtree"
}
},
"topbarLinks": [
{
"name": "Support",
"url": "mailto:[email protected]"
}
],
"topbarCtaButton": {
"name": "Homepage",
"url": "https://spark.laravel.com"
},
"anchors": [
{
"name": "Community",
"icon": "discord",
"url": "https://discord.com/invite/laravel"
},
{
"name": "Blog",
"icon": "newspaper",
"url": "https://blog.laravel.com/spark"
}
],
"navigation": [
{
"group": "Get Started",
"pages": [
"introduction",
"installation",
"customization"
]
},
{
"group": "Spark Paddle",
"pages": [
"spark-paddle/configuration",
"spark-paddle/plans",
"spark-paddle/middleware",
"spark-paddle/events",
"spark-paddle/testing",
"spark-paddle/cookbook",
"spark-paddle/customization",
"spark-paddle/upgrade"
]
},
{
"group": "Spark Stripe",
"pages": [
"spark-stripe/configuration",
"spark-stripe/plans",
"spark-stripe/middleware",
"spark-stripe/taxes",
"spark-stripe/events",
"spark-stripe/testing",
"spark-stripe/cookbook",
"spark-stripe/customization",
"spark-stripe/upgrade"
]
}
],
"footerSocials": {
"x": "https://x.com/laravelphp",
"github": "https://github.com/laravel",
"discord": "https://discord.com/invite/laravel",
"linkedin": "https://linkedin.com/company/laravel"
}
}
Loading

0 comments on commit e85521a

Please sign in to comment.