I am trying to build an application where writers/authors get paid by users/subscribers for premium contents.
I am using the tenancyforlaravel package to structure the tenant and central application and i have installed laravel cashier and stripe in my application.
The problem i am facing is structuring the subscription, I want to ask that what is the best way to go about this.. should the cashier billable trait be on the user model or on the tenant model and should i move the cashier generated migration files into the tenant database folder or how should i go around with this.
Applications like substack have a way of doing this where by a person sign up as a publisher, integrates stripe, create plans and they can choose a post they want for premium.
What is the best approach to this, a really nice response and breakdown will be appreciated.
@henryeti Why do you think this needs multi-tenancy? You’re just describing a two-sided marketplace. I run one myself, but for video content rather than books/written content.
In my application, users create channels. They can then publish videos under those channels. Other users can then rent videos or subscribe to channels. Channel owners then receive income based on rental and subscription revenue.
There’s no “tenants” in the above scenario. Not every application needs to be “multi-tenant”.
@martinbean The reason for me implementing with multi-tenancy is because i want each author to have there own subdomain dashboard like me.example.com/dashboard and isolate, hence why i decided to go to the multi-tenancy route.
I will appreciate if you could share a link to your application please.
@henryeti But that’s just routing. It doesn’t mean it’s “multi-tenancy”.
In my platform, channels are identified using the path (i.e. example.com/channels/acme) but there’d be nothing stopping me using subdomains (i.e. acme.example.com) instead.
@henryeti You don't really need a multi-tenant system.
As @martinbean suggested you could achieve the custom writer/editor specific domain/subdomain using the routes.
I had developed a multi-tenant system last year where each tenant is a contractor, who could manage the quotes/ their customers and billing, with their own white-labelled domains. But in your case, none of your user neds to own the whole "system" as an admin, so no, it is technically not a multi-tenant system.
Thanks @martinbean and @lalitesh i understand this i will try implementing the suggestions. Once the user register they can then create blog by providing subdomain name and then route them to dashboards.
I think this makes more sense instead of having a complicated system with multi-tenant.