PHPackages                             sandrocaputo/rewardful-spark - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sandrocaputo/rewardful-spark

ActiveLibrary[API Development](/categories/api)

sandrocaputo/rewardful-spark
============================

A package to connect your Spark based application to Rewardful.

04PHP

Since Sep 29Pushed 3y agoCompare

[ Source](https://github.com/sandrocaputo/rewardful-spark)[ Packagist](https://packagist.org/packages/sandrocaputo/rewardful-spark)[ RSS](/packages/sandrocaputo-rewardful-spark/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Introduction
============

[](#introduction)

RewardfulSpark is a small library that allows you to integrate your Laravel Spark application with Rewardful with minimal configuration.

Installation
============

[](#installation)

First, require the RewardfulSpark package with Composer

`composer require rewardful/rewardful-spark "3.*"`

Publish the package
-------------------

[](#publish-the-package)

You can publish the configuration separately by running this command.

`php artisan vendor:publish --tag=rewardful-config --force`

You can also publish the Vue components using this command

`php artisan vendor:publish --tag=rewardful-vue --force`

Configuration
=============

[](#configuration)

Before using RewardfulSpark you will need to configure your API key. Add the following line to your `.env` file.

`REWARDFUL_API_KEY=`

Frontend
========

[](#frontend)

In order for Rewardful to capture your referrals information, you need to tinker your `views` and `vue` files slightly.

Blade Layout
------------

[](#blade-layout)

In your blade layout, you need to include this blade directive so it's reflected in all your pages. This will ensure our Javascript library is monitoring all your incoming referrals. For example in the bottom of your `app.blade.php` add the following line before the closing `` tag.

`@rewardful_js`

Vue components
--------------

[](#vue-components)

RewardfulSpark ships with a small Vue components that gets mixed with the `register-stripe` and `subscribe-stripe` components. Depending on your configuration you will need to update those files.

### Laravel Spark 7.0+

[](#laravel-spark-70)

#### Credit Card Upfront

[](#credit-card-upfront)

If you requiring the user to enter their credit card details *Upfront* (i.e. during registration)

Include the vue module into your `resources/js/spark-components/auth/register-stripe.js`. Assuming stock file with no changes, this is how your file should look like.

```
var base = require('auth/register-stripe');
// include the module
var rewardful = require('../../rewardful/rewardful-register');

Vue.component('spark-register-stripe', {
	// add the module as mixing along with the base component
    mixins: [base, rewardful]
});

```

#### No Credit Card Upfront

[](#no-credit-card-upfront)

If you do not require the user to enter their credit card upfront, and provide `GenericTrial`, then you need to ensure the `referral` code is captured during the subscription.

Include the vue module into your `resources/js/spark-components/settings/subscription/subscribe-stripe.js`. Assuming stock file with no changes, this is how your file should look like.

```
var base = require('settings/subscription/subscribe-stripe');
// include the module
var rewardful = require('../../../rewardful/rewardful-register');

Vue.component('spark-subscribe-stripe', {
	// add the module as mixing along with the base component
    mixins: [base, rewardful]
});

```

### Laravel Spark 5 &amp; 6

[](#laravel-spark-5--6)

#### Credit Card Upfront

[](#credit-card-upfront-1)

If you requiring the user to enter their credit card details *Upfront* (i.e. during registration)

Include the vue module into your `resources/assets/js/spark-components/auth/register-stripe.js`. Assuming stock file with no changes, this is how your file should look like.

```
var base = require('auth/register-stripe');
// include the module
var rewardful = require('../../../../js/rewardful/rewardful-register');

Vue.component('spark-register-stripe', {
	// add the module as mixing along with the base component
    mixins: [base, rewardful]
});

```

#### No Credit Card Upfront

[](#no-credit-card-upfront-1)

If you do not require the user to enter their credit card upfront, and provide `GenericTrial`, then you need to ensure the `referral` code is captured during the subscription.

Include the vue module into your `resources/assets/js/spark-components/settings/subscription/subscribe-stripe.js`. Assuming stock file with no changes, this is how your file should look like.

```
var base = require('settings/subscription/subscribe-stripe');
// include the module
var rewardful = require('../../../../../js/rewardful/rewardful-register');

Vue.component('spark-subscribe-stripe', {
	// add the module as mixing along with the base component
    mixins: [base, rewardful]
});

```

Compile your assets
-------------------

[](#compile-your-assets)

For the changes to take effect you need to compile your assets. Run the command relevant to your environment. Assuming production build:

`npm run production`

Changelog
=========

[](#changelog)

Please see CHANGELOG for more information what has changed recently.

Credits
=======

[](#credits)

Mina Abadir

License
=======

[](#license)

The MIT License (MIT). Please see License File for more information.

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/be83632379c49a571bbc86816d69f0348b74a09942d36409a83303d31724fed8?d=identicon)[sandrocaputo](/maintainers/sandrocaputo)

---

Top Contributors

[![mabadir](https://avatars.githubusercontent.com/u/3389914?v=4)](https://github.com/mabadir "mabadir (2 commits)")

### Embed Badge

![Health badge](/badges/sandrocaputo-rewardful-spark/health.svg)

```
[![Health](https://phpackages.com/badges/sandrocaputo-rewardful-spark/health.svg)](https://phpackages.com/packages/sandrocaputo-rewardful-spark)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
