You are browsing documentation for an outdated version of Spike.

Use the version selector on the left (navigation), or visit latest docs here.

Getting started with Spike

Setting up Spike for the first time

Once installed, you should run the Spike's installation to set up all the configuration and vendor files necessary to run Spike. You will not need to run this command during deployment.

php artisan spike:install

If you are using the Jetstream's Teams functionality and prefer billing teams, you can set up Spike for use with teams, like so:

php artisan spike:install --teams

The command will publish a config/spike.php configuration file, where you will be setting up subscriptions, products, and other customization options. Make sure to review the file and make changes where necessary.

The command will also ask for your Stripe API credentials, because Spike depends on Stripe integration being active.

Run the migrations

The previous command has already published a few database migrations. Let's run these migrations, which will create the database tables necessary for Spike's operations.

php artisan migrate

Set up the billable

Next, you should add the SpikeBillable trait to your User model (or the Team model if you will be billing teams). You can learn more about billables here.

use Opcodes\Spike\SpikeBillable;

class User extends Authenticatable
{
    use SpikeBillable;

    // ...
}

Visit the billing portal

You are now ready to access Spike by visiting /billing page of your app!

The /billing path is the default setting.

You can configure the path in the config/spike.php configuration file.

Next steps

After you have installed Spike, here are some common next steps to learn:

Support

If you have any questions, feedback, or need any help setting up Spike within your project, feel free to reach out to me.