users are shared, but orders are tenant-scoped").Problem:
"We’re building [Product X], a [B2B/marketplace/SaaS] platform where [tenants/clients] need isolated data but shared infrastructure. Today, we’d need to either:
- Build custom tenancy logic (6–12 months, high risk), or
- Pay for a proprietary SaaS tenancy solution (recurring costs, vendor lock-in)."
Solution:
"Rinvex Tenants lets us launch a single-database multi-tenancy system in 2 weeks using Laravel—isolating sensitive data (e.g., tenant-specific dashboards) while sharing centralized features (e.g., analytics, support).
- Cost: ~$0 (MIT license) vs. $50K+ for custom dev or SaaS tools.
- Speed: Ship MVP 3x faster than building from scratch.
- Flexibility: Control what data is shared vs. isolated (e.g., GDPR-compliant tenant data).
- Scalability: Supports future needs like franchises or sub-tenants."*
Risk Mitigation:
"We’ll pilot with [Tenant Type A] and validate isolation before scaling. If gaps emerge, we’ll invest in custom extensions (low risk due to open-source)."
Why This Package?
"Rinvex Tenants solves 90% of our multi-tenancy needs with Laravel’s native tools (no external dependencies). Key advantages:
- Single-DB Efficiency: No schema replication or connection management overhead.
- Polymorphic Tenancy: Supports shared tables (e.g.,
users,roles) and tenant-scoped tables (e.g.,tenant_orders) via query scopes and middleware.- Laravel Native: Integrates with Eloquent, migrations, and caching (e.g.,
tenant()helper for context-aware queries).- Extensible: We can override defaults (e.g., custom tenant resolution logic) without forking the package."*
Implementation Plan:
tenants table, and define shared vs. isolated models.TenantMiddleware to auto-resolve tenants from subdomains/IDs).TenantA can’t see TenantB’s orders) and shared data (e.g., all tenants see the same pricing).Alternatives Considered:
| Solution | Pros | Cons | Our Choice |
|---|---|---|---|
| Custom Middleware | Full control | 6–12 months dev time | ❌ |
| Spatie Tenancy | More features | Overkill for our needs | ❌ |
| Multi-DB | Strong isolation | High ops complexity | ❌ |
| Rinvex Tenants | Laravel-native, lightweight | Limited real-time provisioning | ✅ |
Open Questions for the Team:
How can I help you explore Laravel packages today?