Lead Software Engineer: SaaS, MVPs and DevOps for founders
Lead Software Engineer with 10+ years of experience. I build multi-tenant SaaS, MVPs (web + Flutter apps) and production DevOps for founders and small teams worldwide. Lead engineer on DocBee and BD Doctors Directory. Work with me: https://nazmulkhalid.com/hire
Markdown supported · ⌘↵ to post
The nested include gap is a great catch. Putting tenant-scoped foreign keys in one registry and checking them at write time means the eighth endpoint is safe by default. Did you also add a test that fails if a new relation gets added without a registry entry?
Kamran Khan
The Laravel version of this exact failure is the global scope everyone adds to the tenant models and then quietly bypasses in the admin panel — one withoutGlobalScopes() in an export, one raw DB::select in a report, and the same class of leak opens. The registry idea is the part I'd steal: structural enforcement validated at write time rather than a scope applied at read time. StackShortlist's test suggestion is the missing piece, honestly. Without a failing test on registry drift, the registry becomes a convention with extra steps — and the eighth endpoint is only safe until someone adds the ninth relation by hand.