Im very interested to know if possible to do this too. @cboxdk hows your finding so far?
Addon products?
We have some addon products for our system. Is there a way to bill our customers for theese with Spark, or will it be possible?
E.g. we have a basic, pro and premium subscription. However, we also have addons like, VIP support, extra diskspace or similar.
The pieces are there but it's something you'll need to build yourself. Stripe supports individual products and subscription quantities, and the Spark APIs allow you to generate arbitrary invoices and charges, but it's up to you to glue that together.
There are two things that come to mind.
- You can easily do one-time charges mith spark - just refer to the cashier documentaion on it.
- stripe offers something that they call 'invoice items' which is an additional priced item on next billing at start of ext billing period.
I suspect that it should be rather simple do add as the customer token for verification etc. are already in your database for the user. But I have not done it myself, yet.
You find it here https://stripe.com/docs/subscriptions/guide#adding-invoice-items
Thank you for your suggestion. However, i'm not looking for one-times charges, but addons to the subscription or even more granular control.
E.g. Add a $10 fee for VIP support on top of the regular subscription. Charge $2 per user in a team on top of the monthly package and not a fixed step model like Spark do now.
Stuff like this. :)
I guess i can charge it as one-time on a recurring basis, but the ideal solution would be one charge and one invoice every month, except for upgrades during the month.
I have found the Stripe code to create custom subscription which may be the solution here and now, but a more integrated solution in Spark would be ideal of course.
@cboxdk hey.
Why not fake it? If you don't want to add any functionality in your own, you can fake it by creating plans that contains that service you want to offer and reflect the change in the price.
However, it will get nasty really quick as you will need to have a plan for every possible mix of plan and addons. If you have just a few, it may work.
I have a fine idea on how to make this work. My insight when i asked the question compared to now is also completely different. :)
I will surely have to develop this myself, but i do see a big gap in the subscription system in Spark's current version compared to the granularity needed for many SaaS applications.
With that said i'm still a big fan of both Laravel and Spark. ;)
Maybe you can share your intended approach in a few bullet points summarizing how you intend to tackle the setup in general.
is there any update to this?
I'm seeing info on stripe's website that suggests addons would work: https://stripe.com/docs/subscriptions/invoices#adding-invoice-items
another possible solution to have multiple subscriptions https://stripe.com/docs/subscriptions/multiple, but this also doesn't seem to be supported in spark. (https://laracasts.com/discuss/channels/spark/spark-user-with-multiple-subscriptions).
I know this thread is pretty old now but I implemented add-on subscriptions for my Spark app and wrote up a guide detailing the steps
It was written for Spark 5 so there may need to be some minor modifications (mostly to the view) if you're on Spark 6
The main result is the ability to define add-on plans in the same way we define Spark plans
// SocketCluster
Spark::addon(new \App\Addon([
'id' => 'socketcluster',
'name' => 'SocketCluster',
'description' => "A scalable framework for real-time apps and services.",
]));
// SocketCluster - Plan: Hobby
Spark::addonPlan('socketcluster', 'Hobby', 'socketcluster:hobby')
->price(19)
->trialDays(15)
->features([
"Powered by 512mb RAM",
"No complicated setup",
"Email support"
])
->attributes([
'description' => "Single 512mb SocketCluster instance, perfect for development",
]);
Part 1: https://codemason.io/blog/laravel-spark-addon-subscriptions/
Part 2: https://codemason.io/blog/laravel-spark-addon-subscriptions-part-2/
Hopefully that's helpful
@benmag Thank for for that detailed writeup! It looks like you've put quite a bit of work into that. Have you thought about making a package or putting it on github?
@Cronix I'd love to turn it into a package. I just wasn't sure about how to approach things since it requires modifying the Spark class, routes, assets etc
But I'll take another look when I get some time because a package would be so much easier than that huge guide!
Please or to participate in this conversation.