kjos / orchestra
Orchestra tool for Laravel and other
Requires
- php: >=7.0
- archtechx/enums: ^1.1
- illuminate/console: ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0
- illuminate/database: ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0
- illuminate/routing: ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0
- illuminate/support: ^8.0 || ^9.0 || ^10.0 || ^11.0 ||^12.0
- laravel/pint: ^1.20
Requires (Dev)
- fakerphp/faker: ^1.23
- friendsofphp/php-cs-fixer: ^3.75
- mockery/mockery: ^1.6
- nunomaduro/collision: ^5.0
- orchestra/testbench: ^6.47
- pestphp/pest: ^1.23
- pestphp/pest-plugin: ^1.1
- pestphp/pest-plugin-laravel: ^1.4
- phpro/grumphp: ^2.5
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^9.5
- dev-main
- 1.0.0
- dev-OOR-16-orchestra-unable-to-resolve-the-template-type-t-key-in-call-to-function-collect
- dev-OOR-15-orchestra-implementer-la-gestion-des-test-master-et-slave
- dev-OOR-12-orchestra-gestion-des-permissions
- dev-OOR-8-orchestra-creation-des-virtualhost
- dev-OOR-7-orchestra-gestion-des-routes
- dev-OOR-6-meilleur-gestion-du-rollback-apres-erreur
- dev-OOR-5-orchestra-retirer-les-fichier-necessaire-apres-desinstallation
- dev-OOR-4-orchestra-ajouter-le-provider-dans-les-config
- dev-OOR-3-orchestra-configuration-tenant
This package is auto-updated.
Last update: 2025-07-12 04:22:14 UTC
README
π Multilangue | Multilingual
- π«π· Version FranΓ§aise
- π¬π§ English Version
π¬π§ English
kjos orchestra
A powerful multi-tenancy manager for Laravel, with built-in support for domain isolation, database separation, and automated Apache virtual host configuration.
Installation
composer require kjos/orchestra
Master tenant installation
Before beginning you must install the master tanant.
We will ask you to configure the User
wo will use for virtuals hosts creation.
When User
is configure, a shedule task is creating in your crontab table, you can type crontab -e
to see it.
The shedule task will use your User
with it privileges to automate the creation et configuration of your virtualhost
.
virtualhosts
are configured in /etc/apache2/sites-available directory.
Concept
kjos/orchestra
simplifies the management of multi-tenant applications by providing:
-
Independent databases per tenant
-
Separate route files, config, and storage per tenant
-
Automatic setup of Apache virtual hosts
-
Easy tenant lifecycle management via Artisan commands
Itβs ideal for SaaS platforms or systems requiring strict tenant isolation.
Getting Started
Master Tenant Setup
Before adding tenants, you must install and configure the master tenant.
What happens during setup?
Youβll configure a system User that will be used to manage Apache virtual hosts.
A scheduled task will be added to your crontab to automate virtual host creation.
Apache virtual hosts are stored in: /etc/apache2/sites-available/
Installation Steps
-
Create & configure the master tenant
-
Publish the config file:
php artisan vendor:publish --tag=orchestra-config
-
Create the database for the master tenant
-
Add the tenant to the .tenants file at your project root
-
Create the site/ directory, which will contain subfolders for each tenant
-
Link each tenant's /public directory to your Laravel public root
-
Configure the virtual host:
-
Symlink: /var/www/html/{tenant-domain} β project/site/{tenant-name}
-
Apache config: /etc/apache2/sites-available/{tenant-domain}.conf
-
Log file: /var/log/apache2/{tenant-domain}.log
- Enable the virtual host:
sudo a2ensite {tenant-domain}.conf
sudo systemctl reload apache2
- Register the service provider in config/app.php:
App\Providers\TenantServiceProvider::class,
The TenantServiceProvider
is the central kernel that initializes and resolves tenant-specific context and configuration.
Artisan Commands
Install Master Tenant
php artisan orchestra:install the_master_tenant_name --domain=master_tenant_domain --driver=[mysql|pgsql]
β Uninstall Master Tenant
php artisan orchestra:uninstall the_master_tenant_name --driver=[mysql|pgsql]
β Create a New Tenant
php artisan orchestra:create the_tenant_name --domain=the_tenant_domain --driver=[mysql|pgsql] --migrate
β Delete a Tenant
php artisan orchestra:delete the_tenant_name --driver=[mysql|pgsql]
π§Ύ Available Options
Option | Description |
---|---|
--domain |
The domain of the tenant |
--driver |
Database driver pgsql or mysql |
--migrate |
Either migrate the fresh tenant database or not |
Additional Features
Each tenant has its own:
-
routes
(API, web, console) -
database
-
storage
&cache
-
config
context
Crontab automation for managing virtual hosts
Support for Laravel testing with tenant isolation
Dynamic tenant discovery via .tenants
file
.
π Directory Structure
project-root/
βββ site/
β βββ master/
β β βββ routes/
β βββ tenant-a/
β | βββ routes/
| |__ tenant-b/
| |__routes/
|
βββ .tenants
βββ config/orchestra.php
βββ app/Providers/TenantServiceProvider.php
π€ Author
Maintained by Jean Koffi
π License
MIT Β© kjos/orchestra
π€ Call for contributions
This project is open to contributions! Are you a developer, passionate about Laravel, or interested in multi-tenant architecture?
-
Fork the project
-
Create a branch (koor/my-feature)
-
Make a PR π§ͺ
There are many other command for additionally configuration.