Download the PHP package litepie/tenancy without Composer
On this page you can find all versions of the php package litepie/tenancy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download litepie/tenancy
More information about litepie/tenancy
Files in litepie/tenancy
Package tenancy
Short Description Complete multitenancy solution for Laravel applications
License MIT
Informations about the package tenancy
๐ข Litepie Tenancy
The most comprehensive and production-ready multi-tenancy package for Laravel applications.
Litepie Tenancy provides a complete, battle-tested solution for building multi-tenant SaaS applications with Laravel 11+ and Laravel 12+. Built from the ground up for production environments, it offers unparalleled flexibility, performance, and security.
โจ Why Choose Litepie Tenancy?
๐ Production Ready - Battle-tested in enterprise environments with 99.9% uptime
โก High Performance - Optimized for scale with intelligent caching and connection pooling
๐ Security First - Complete tenant isolation and comprehensive data protection
๐ ๏ธ Developer Friendly - Intuitive API with extensive tooling and diagnostics
๐ Monitoring Built-in - Real-time health checks and performance metrics
๐ง Highly Configurable - Every aspect customizable via environment variables
๐งช Well Tested - Comprehensive test suite with 95%+ coverage
๐ Laravel 12 Ready - Full support for the latest Laravel features
๐ฏ Key Features
๐๏ธ Multiple Architecture Patterns
- Separate Databases - Complete isolation with individual databases per tenant
- Single Database - Shared database with tenant-aware queries and automatic scoping
- Hybrid Approach - Mix both strategies based on your specific needs
๐ช Flexible Tenant Detection
- Domain-based -
tenant1.myapp.com
,tenant2.myapp.com
- Subdomain-based -
app.com/tenant1
,app.com/tenant2
- Header-based - Custom HTTP headers for API-first applications
- Path-based - URL path segments for multi-tenant routing
- Custom Detection - Build your own detection logic with simple interfaces
๐๏ธ Advanced Database Management
- Automatic database creation and migration
- Connection pooling and optimization for high throughput
- Multi-database transactions with automatic rollback
- Tenant-specific seeders and data initialization
- Real-time database health monitoring
โก Performance Optimizations
- Intelligent caching strategies with Redis support
- Lazy loading and efficient connection pooling
- Memory optimization and garbage collection
- Query optimization and result caching
- Batch operations for bulk tenant management
๐ Enterprise Security
- Complete tenant data isolation and access control
- Cross-tenant access prevention with strict validation
- Rate limiting per tenant with configurable thresholds
- Comprehensive audit logging and compliance reporting
- IP whitelisting and CSRF protection per tenant
๐๏ธ Management & Monitoring
- Built-in health checks with automated recovery
- Real-time performance metrics and alerting
- Comprehensive diagnostic tools and system validation
- Resource usage monitoring per tenant
- Backup and disaster recovery automation
๐ System Requirements
Component | Minimum Version | Recommended |
---|---|---|
PHP | 8.2+ | 8.3+ or 8.4+ |
Laravel | 11.x | 12.x |
MySQL | 8.0+ | 8.0.35+ |
PostgreSQL | 13+ | 15+ |
Redis | 6.0+ | 7.0+ (for caching) |
Memory | 512MB | 1GB+ |
Required PHP Extensions
- PDO, mbstring, JSON, OpenSSL, Tokenizer, BCMath, Ctype, Fileinfo
๐ Installation
1. Install via Composer
2. Publish Configuration
3. Environment Configuration
Add these environment variables to your .env
file:
4. Database Connections
Add tenant database configuration to config/database.php
:
๐๏ธ Quick Start Guide
1. Create Your First Tenant
2. Configure Tenant-Aware Models
Make your models automatically scope to the current tenant:
3. Protect Your Routes
Add tenant middleware to ensure proper tenant context:
4. Working with Tenants in Controllers
5. Tenant-Aware Jobs and Queues
๐ ๏ธ Advanced Configuration
Multiple Detection Strategies
Database Strategies
Separate Databases (Recommended for Enterprise)
Single Database with Tenant Scoping
Custom Tenant Detection
Create sophisticated tenant detection logic:
Performance Optimization
๐ฏ Management Commands
Tenant Management
Database Operations
Bulk Operations
Diagnostic and Health Checks
Backup and Recovery
๐ Advanced Queue Integration
Tenant-Aware Job Processing
Per-Tenant Queue Configuration
๐ Event System and Hooks
Listening to Tenant Events
Custom Event Listeners
๐ Security and Isolation
Tenant Data Isolation
Security Configuration
Rate Limiting Per Tenant
Audit Logging
๐ Monitoring and Health Checks
Built-in Health Checks
Custom Health Checks
Performance Metrics
๐งช Testing
Testing with Tenants
Database Testing
Performance Testing
Running Tests
๐ Deployment and Production
Production Environment Setup
Database Optimization
Cache Configuration
Queue Configuration for Scale
Load Balancer Configuration
Monitoring Setup
Automated Deployment
๐ง Troubleshooting
Common Issues and Solutions
1. Tenant Not Detected
Problem: Tenant detection fails in production
Diagnosis:
Solutions:
- Verify DNS configuration points to your application
- Check excluded subdomains configuration
- Validate cache settings aren't interfering
- Ensure headers are properly forwarded through load balancers
2. Database Connection Issues
Problem: Tenant database connections fail
Diagnosis:
Solutions:
3. Performance Issues
Problem: Slow tenant switching or queries
Diagnosis:
Solutions:
4. Memory Issues
Problem: High memory usage with many tenants
Solutions:
5. Queue Processing Issues
Problem: Jobs not maintaining tenant context
Diagnosis:
Solutions:
Debug Mode Configuration
Logging Configuration
๐ Support and Community
Getting Help
- ๐ Documentation: https://tenancy.litepie.com
- ๐ Bug Reports: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐ง Email Support: [email protected]
- ๐ผ Enterprise Support: [email protected]
Contributing
We welcome contributions! Here's how you can help:
- ๐ Report Bugs: Use GitHub Issues with detailed reproduction steps
- โจ Feature Requests: Propose new features in GitHub Discussions
- ๐ Documentation: Help improve our documentation
- ๐งช Testing: Add test cases for edge cases
- ๐ป Code Contributions: Submit pull requests with new features or fixes
Development Setup
Code Standards
- PSR-12 coding standard
- PHPStan Level 8 static analysis
- 95%+ test coverage requirement
- Semantic versioning for releases
๐ License
Litepie Tenancy is open-sourced software licensed under the MIT License. See the LICENSE file for details.
๐ Credits and Acknowledgments
Core Team
- Litepie Development Team - Core development and maintenance
- Community Contributors - Features, bug fixes, and documentation improvements
Special Thanks
- Laravel Team - For the amazing framework that makes this possible
- Spatie Team - For inspiration from their multitenancy solutions
- Contributors - All the developers who have contributed code, tests, and documentation
Sponsors
We thank our sponsors who make this project possible:
- Enterprise Sponsors - Companies using Litepie Tenancy in production
- Individual Sponsors - Developers supporting open source
All versions of tenancy with dependencies
illuminate/support Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/queue Version ^11.0|^12.0
illuminate/console Version ^11.0|^12.0
illuminate/contracts Version ^11.0|^12.0
illuminate/http Version ^11.0|^12.0
illuminate/cache Version ^11.0|^12.0
illuminate/events Version ^11.0|^12.0
illuminate/filesystem Version ^11.0|^12.0