Team Billing
Spark ships with “user” based billing by default. If your applications bills teams or a different model instead, you will need to adjust your Spark installation accordingly. We’ll walk through these adjustments in the following documentation using a team billing implementation as an example. To make theApp\Models\Team
model our billable model, we first need to adjust Spark’s service provider.
Updating the Service Provider
Now we should update theSparkServiceProvider
to reference the Team
model instead of the User
model:
app/Providers/SparkServiceProvider.php
Updating the Model
Now we can update theTeam
model to use the Spark\Billable
trait and implement a paddleEmail
method that returns the team owner’s unique email address to be displayed in the Paddle dashboard as the customer identifier:
app/Models/Team.php
Spark Configuration File
Finally, update your application’sconfig/spark.php
configuration file so that it defines a team
billable model:
config/spark.php