rahmatcmos / laravel_tenancy_template

This project is a template implementation with Laravel 7 and Tenancy.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

This project is a template implementation with Laravel 7 and Tenancy.


Languages

Language:PHP 81.1%Language:HTML 18.6%Language:Vue 0.4%