- PHP (>= 7.0) installed
- npm installed (https://www.npmjs.com/get-npm)
- MySQL 5.7 (https://dev.mysql.com/downloads/mysql/5.7.html) Important! MySQL 8.0 is not supported for Tenancy
- Clone repository
- run
composer install(https://getcomposer.org) - Copy
.env.examplefile as.env. - Confgurate databases access in
.envfile. (Is very important to complete the TENANT_DATABASE information!). - run
php artisan key:generate - run
php artisan migrate --database=system - run
npm install - run
npm run dev
- run
php artisan tenant:createNewTenant myNewTenantWebsiteName - Access it by http://myNewTenantWebsiteName.yourSiteUrl.com.
- For System:
app/Http/Controllers - For tenant:
app/Http/Controllers/Tenant
- For System:
app/Models - For tenant:
app/Models/Tenant- (Each model inside tenant must implement the interface
Hyn\Tenancy\Traits\UsesTenantConnection)
- (Each model inside tenant must implement the interface
- For system:
database/migrations - For tenant:
database/migrations/tenant
- For system:
routes/web.php - For tenant:
routes/tenants.php
- Views for system:
reources/views - Views for tenant:
reources/views/tenant