Multi-Tenancy Core
Multi-database multitenancy module with SaaS management for Laravel ERP. This module is required for the SaaS edition and enables running Open Core Business Suite as a multi-tenant platform.
Features
- Multi-Database Tenancy: Complete database isolation per tenant for security and performance
- Tenant Registration: Public registration form for new tenants with field validation
- Tenant Management: Full management of tenants including approval, suspension, and activation
- Tenant Approval Queue: Review and approve/reject pending tenant registrations
- Plan Management: Create and manage subscription plans with CRUD operations
- Subscription Management: Track tenant subscriptions, renew, cancel, or change plans
- Payment Management: Payment approval queue, payment history, and proof-of-payment uploads
- Database Provisioning: Automated or manual tenant database provisioning
- Tenant Portal: Self-service portal for tenants to manage subscriptions, billing, invoices, usage, and profile
- SaaS Settings: Centralized settings for registration, trials, payment gateways, and provisioning
- Offline Payments: Built-in support for offline/bank transfer payments with proof upload
- Payment Gateway Integration: Toggle and configure Stripe, Razorpay, and PayPal gateways
- Email Templates: Customizable email templates for tenant communications
- Organization Lookup API: Public API for mobile apps to look up tenant organizations
Requirements
- Open Core Business Suite (Base System)
- Database server with permissions to create databases
- Wildcard subdomain configuration on your server
Installation
Enable via Admin Panel
- Log in as administrator
- Navigate to Settings > Addons
- Find Multi-Tenancy Core and click Enable
- Run migrations if prompted
Enable via Command Line
php artisan module:enable MultiTenancyCore
php artisan migrate
Post-Installation
Configure your web server for wildcard subdomains to support tenant-specific URLs.
Navigation
Access SaaS management through the sidebar menu (super_admin role required):
- SaaS Management > Dashboard - Overview and statistics
- SaaS Management > All Tenants - View and manage all tenants
- SaaS Management > Approval Queue - Review pending tenant registrations
- SaaS Management > Plans - Manage subscription plans
- SaaS Management > Subscriptions - Manage tenant subscriptions
- SaaS Management > Payment Approval Queue - Review pending payment approvals
- SaaS Management > Payment History - View all payment history and statistics
- SaaS Management > Database Provisioning - Manage tenant database provisioning
- SaaS Management > SaaS Settings - Configure platform settings
Usage
Tenant Management
Navigate to SaaS Management > All Tenants to manage tenants:
- View all tenants with datatable filtering and sorting
- View individual tenant details
- Edit tenant information
- Approve or reject pending tenants
- Suspend or activate tenant accounts
Tenant Approval
Navigate to SaaS Management > Approval Queue to:
- Review pending tenant registration requests
- Approve tenants to grant access
- Reject tenants with a reason
Plan Management
Navigate to SaaS Management > Plans to:
- Create new subscription plans with pricing and features
- Edit existing plans
- View plan details and assigned tenants
- Delete unused plans
Subscription Management
Navigate to SaaS Management > Subscriptions to:
- View all active subscriptions
- Create new subscriptions for tenants
- Cancel or renew subscriptions
- Change tenant plans
- View expiring subscriptions
Payment Management
Navigate to SaaS Management > Payment Approval Queue to:
- Review pending offline/manual payments
- View uploaded payment proofs
- Approve or reject payments
- Upload payment proofs on behalf of tenants
Navigate to SaaS Management > Payment History to:
- View all payment history with filtering
- View payment statistics
- Download payment details
Database Provisioning
Navigate to SaaS Management > Database Provisioning to:
- View tenant provisioning status
- Auto-provision tenant databases (creates database, runs migrations, seeds data)
- Manually provision with custom database credentials
- View provisioning history and statistics
Tenant Portal
Tenants access their self-service portal at /tenant/ with these sections:
- Dashboard - Tenant overview
- Plan Selection - Choose or change subscription plan
- Subscription - View current subscription, change plan, cancel, or resume
- Billing - View payment instructions, upload payment proofs
- Invoices - View and download invoices
- Usage - Monitor resource usage
- Profile - Update company profile
- Support - Access support resources
Configuration
SaaS Settings
Navigate to SaaS Management > SaaS Settings to configure:
General Settings
| Setting | Description | Default |
|---|---|---|
| Allow Tenant Registration | Enable public tenant registration | Enabled |
| Auto-Approve Tenants | Automatically approve new registrations | Disabled |
| Require Email Verification | Require email verification for new tenants | Enabled |
| Default Plan | Default plan for new tenants | - |
| Enable Trial | Allow trial subscriptions | Enabled |
| Trial Days | Duration of trial period | 14 |
| Require Payment for Trial | Require payment info during trial signup | Disabled |
| Grace Period Days | Days after subscription expiry before suspension | 3 |
| Platform Name | Display name for the SaaS platform | App Name |
| Support Email | Support contact email | - |
| Currency | Default currency code | USD |
| Currency Symbol | Currency display symbol | $ |
| Terms URL | Link to terms of service | - |
| Privacy URL | Link to privacy policy | - |
Database Provisioning Settings
| Setting | Description | Default |
|---|---|---|
| Auto Provisioning | Automatically provision tenant databases on approval | Disabled |
| DB Host | Database server host for tenant databases | localhost |
| DB Port | Database server port | 3306 |
| DB Username | Database user for creating tenant databases | root |
| DB Password | Database password | - |
Payment Gateway Settings
- Offline Payments: Configure bank details (bank name, account name, account number, routing number, SWIFT code, bank address, payment instructions)
- Payment Gateways: Toggle enable/disable for Stripe, Razorpay, and PayPal gateways (each gateway requires its own module)
API Endpoints
Organization Lookup (Public)
Look up a tenant organization by domain or identifier for mobile app connection.
POST /api/V1/organization/lookup
Tenant Info (Authenticated)
Get current tenant information.
GET /api/V1/tenant/info
Requires authentication and tenant context middleware.
SaaS Edition Note
This module is included only in the SaaS edition of Open Core Business Suite. It is not available in the standard single-tenant package.
Changelog: View version history