Skip to content

ametad/laravel-app-multi-tenant-demo

Repository files navigation

Demo multi tenant Laravel app

Installation

Set your hosts file, for correct DNS resolution:

192.168.10.10 homestead.test
192.168.10.10 foo.test
192.168.10.10 bar.test

Run the following commands on your host machine:

Run the next commands inside the vm:

  • cd code
  • artisan migrate --database=system
  • artisan website:create
  • artisan hostname:create --website_id=1 foo.test
  • artisan hostname:create --website_id=1 bar.test

Note the artisan website and hostname commands are not from the hyn/multi-tenant package.

asciicast

Example Homestead.yaml

ip: 192.168.10.10
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
    - ~/.ssh/id_rsa
folders:
    -
        map: /home/user/laravel-app-multi-tenant-demo
        to: /home/vagrant/code
sites:
    -
        map: homestead.test
        to: /home/vagrant/code/public
    -
        map: foo.test
        to: /home/vagrant/code/public
    -
        map: bar.test
        to: /home/vagrant/code/public
databases:
    - homestead
name: laravel-app-multi-tenant-demo
hostname: laravel-app-multi-tenant-demo

About

Demo of Laravel 5 multi tenant implementation of https://github.com/hyn/multi-tenant/

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages