If you are looking for Configuration Tenant Driver for Multiple Databases, Please Click here
Clone or Download the Repository to the htdocs / www folder.
Update Composer by typingComposer update in the command line on the root directory of project.
Change default database configuration in config/database.phpWe are using
mysql as default connection'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'), //This database will be the root for all other databases, can manage other databases tables etc
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
],
We already have some Role seeder, So we also need to seed the database along with migration
Run migration by typing
php artisan migrate --seedin the command line
To create a migration for Tenantsimply type php artisan tenanti:make site create_tablename_table
in the command line
The tenant migration will be under database/tenant/sites/
Please feel free to contribute and send pull request.