Skip to content

Latest commit

 

History

History
43 lines (38 loc) · 1.5 KB

README.md

File metadata and controls

43 lines (38 loc) · 1.5 KB

Peretch/laravel_tenancy_template

Prerequisites

Instalation

  1. Clone repository
  2. run composer install (https://getcomposer.org)
  3. Copy .env.example file as .env.
  4. Confgurate databases access in .env file. (Is very important to complete the TENANT_DATABASE information!).
  5. run php artisan key:generate
  6. run php artisan migrate --database=system
  7. run npm install
  8. run npm run dev

Creating new Tenant

  1. run php artisan tenant:createNewTenant myNewTenantWebsiteName
  2. Access it by http://myNewTenantWebsiteName.yourSiteUrl.com.

Used technologies

Structure of code

Controllers

  • For System: app/Http/Controllers
  • For tenant: app/Http/Controllers/Tenant

Models

  • For System: app/Models
  • For tenant: app/Models/Tenant
    • (Each model inside tenant must implement the interface Hyn\Tenancy\Traits\UsesTenantConnection)

Migrations

  • For system: database/migrations
  • For tenant: database/migrations/tenant

Routes

  • For system: routes/web.php
  • For tenant: routes/tenants.php

Resources

  • Views for system: reources/views
  • Views for tenant: reources/views/tenant