Easy2Dev Laravel Tenant Migrate is a Laravel package designed to simplify database migration for multi-tenant applications, particularly those employing PostgreSQL databases.
This package streamlines the migration process for Software as a Service (SaaS) for Laravel web applications where tenant data is stored in separate databases. It eliminates the need to manually adjust database configuration files for each tenant, offering a scalable solution for database management.
- Seamless migration of tenant databases without manual configuration adjustments.
- Support for multiple migration commands tailored for tenant databases.
- Simultaneous migration of multiple tenant databases using database prefixes.
- Compatibility with Laravel artisan commands for streamlined workflow integration.
To install Easy2Dev Laravel Tenant Migrate, follow these steps:
- Install the package via Composer:
composer require easy2dev/multi-tenant-wizard
- Verify the installation by running
php artisan
. If the package commands are listed, the installation was successful.
Easy2Dev Laravel Tenant Migrate provides the following artisan commands for managing tenant databases:
php artisan tenant:database:create [database-name]
Parameter | Description |
---|---|
database-name |
Required. The name of the specific tenant database to be create |
php artisan tenant:migrate [database-name] [--path=]
Parameter | Description |
---|---|
database-name |
Required. The name of the specific tenant database to be migrate |
--path= |
Optional. The path to the schemas to be migrated (Default location is /database/migrations/tenant) |
php artisan tenant:migrate:all [database-prefix] [--path=]
Parameter | Description |
---|---|
database-prefix |
Required. The common prefix shared by the names of the tenant databases to be migrated |
--path= |
Optional. The path to the schemas to be migrated (Default location is /database/migrations/tenant) |
php artisan tenant:migrate:rollback [database-prefix] [--step=]
Parameter | Description |
---|---|
database-prefix |
Required. The common prefix shared by the names of the tenant databases to be rollback |
--steps= |
Optional. Specifies the number of migration steps to roll back. |
php artisan tenant:migrate:refresh [database-prefix] [--step=]
Parameter | Description |
---|---|
database-prefix |
Required. The common prefix shared by the names of the tenant databases to be refresh |
--path= |
Optional. The path to the schemas to be migrated (Default location is /database/migrations/tenant) |
php artisan tenant:migrate:reset [database-prefix]
Parameter | Description |
---|---|
database-prefix |
Required. The common prefix shared by the names of the tenant databases to be reset |
php artisan tenant:db:seed [database-prefix]
Parameter | Description |
---|---|
database-prefix |
Required. The common prefix shared by the names of the tenant databases where data will be seeded |
This project is licensed under the MIT License.
Special thanks to our contributors and supporters for their valuable contributions to this project.