SaaS with team functionality

entwicklung

Oct 28th, 2024 08:43 AM

Hello devdojo team, I want to create a SaaS solution which offers team functionality, so that a user can let other users join his team. Therefore the billable would not be the user model, but a team model. Is this somehow possible, and if so what would be the best way to keep clean in case of any updates of Wave, Laravel, etc. Thank you in advance!

Report
2
bobbyiliev

Oct 30th, 2024 01:55 AM

Hey!

Thanks for reaching out with this great idea. Currently, Wave v3 doesn’t offer team functionality out of the box, so billing is still associated with individual users rather than a team model. That said, we love the concept and have added it to our backlog for potential future updates!

In the meantime, you're absolutely free to modify the existing codebase to implement team functionality as needed. Thanks again for the suggestion!

- Bobby

tnylea

Oct 30th, 2024 04:46 PM

Hey entwicklung,

I was actually the one that built the billing functionality and I forget to let Bobby know how it works under the hood 🤪

So, here's an example of how the billing table looks. The subscriptions table includes a column for that references the plan_id and it also contains status info and other info about the specific provider (stripe or paddle), it also contains two important columns, which are:

  • billable_type
  • billable_id

This is a morphs to many relationship, which means that it can reference any id within any table. By default the billable_type is user which map to App\Models\User and the billable_id will be the user id. However, you could create an App\Models\Team and then the billable_type would be team and the billable_id would be the id of the team.

In this case you could setup a Plan where you tell the user they can purchase it and get 10 user seats. When the user purchases they will be able to add 10 people to that team and that team will have an active subscription.

Let me know if that helps.

We do have plans to create a Team plug-in in the future that will add team functionality. If you are interested in colaborating to build this we would be open to that as well and could offer you a smal compensation for your efforts in addition to having this functionality.

Let me know if you have any other questions. Really appreciate it!

Report
2