New to Adonis and web development on a whole. I come from the desktop world primarily using .net.
I’ve never used laravel but I came across Adonis and it just felt right so i’m about to start a new project using adonis 4 but I just wanted some basic guidance on what any of the experienced guys here would recommend in terms of multi-tenancy setup.
I’m going the standard route where all the tables will have in a tenant_id field where neccessary. To minimise room for error where I may forget a where clause to filter the data, what would be a good way to setup a kind of global filter that functions transparently. Should that be a middleware, a hook or something else?
I’ll be using jwt authentication and I will store the tenant_id as part of the payload of the token so I will know what the tenant should be for filter selects and for inserts.
I hope what i’m asking is clear, looking forward to any help you guys can provide.