This repository serves as a starter kit for developing multi-tenancy applications with a database-per-tenant architecture using Filament V3 integrated with Laravel 11 and supported by Laravel Octane for high-performance handling of concurrent requests. Each tenant has its own database, ensuring data isolation and security between tenants. This setup includes a comprehensive management interface and custom migration commands tailored for this architecture.
- Laravel 11: Utilize the latest features of Laravel 11 for robust backend development.
- Laravel Octane: Enhances the performance of the application using high-powered server handling capabilities, ideal for high concurrency environments.
- Filament 3: Integrated Filament 3 admin panel for intuitive management interfaces.
- Multi-Tenancy: Core support for a database-per-tenant architecture, which allows distinct and isolated data management for different tenants.
- Dual Panel System:
- Admin Panel: For system-wide management tasks.
- App Panel: For tenant-specific operations.
- Enhanced User Model: Includes an
administratorflag to distinguish between regular users and administrators. - Custom Migration Command:
weblabs:migrate-tenantsfacilitates migration specifically tailored to operate across multiple tenant databases. It supports an optional--siteparameter to specify a tenant ID for targeted operations.
To get started with this starter kit, clone the repository to your local machine:
git clone https://github.com/will2therich/Filament-3-multitennant-starter.git
cd filament-3-multitennant-starter
Ensure you have the following installed:
- PHP >= 8.3
- Composer
- Node.js and npm (for compiling assets)
-
Install PHP dependencies:
composer install -
Setup your environment file:
cp .env.example .env -
Generate an app key:
php artisan key:generate -
Run migrations and seed the database (if applicable):
php artisan migrate --seed -
Start the development server:
php artisan serve
To migrate tenant databases, use the custom command:
php artisan weblabs:migrate-tenantsOptional parameter to target a specific tenant:
php artisan weblabs:migrate-tenants --site={tenant_id}Contributions are welcome! Please read our contributing guidelines before submitting pull requests.
For support please open an issue in this repository.
This project is licensed under the MIT License - see the LICENSE.md file for details.
This starter kit is maintained by WebLabs Technologies.