This repository puts together the most common building blocks necessary for developing a multi tenant SAAS application using Laravel, thus enabling users to jumpstart their SAAS application development with separate tenant databases.
It provides
- Register Page for new project with New Domain.
- Multi tenancy with separate databases
This starter boilerplate is built on Laravel 6.2. Hence, working knowledge of Laravel is required.
- Download the repository by cloning it or in zip format & extract to your project folder
- Run 'composer install' to install the packages used in this project.
composer install
- Copy .env.example to .env & update the necessary parameters.
- Change your domain in .env
CENTRAL_DOMAIN = example.com
and add domain inconfig/tenancy.php
in array ofexempt_domains
which is your main(central) domain.
- "stancl/tenancy": "^2.3"
Setup domain with your project with creating virtual host.
Create Virtual Host step by step
Note : cPanel it will not work as it will create dynamic database.
You have to add *.
in ServerAlias
to support dynamic subdomains.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName example.com
ServerAlias *.example.com
VirtualDocumentRoot /var/www/example.com/public
DocumentRoot /var/www/example.com/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
This project is free for anyone who wishes to copy and replicate / customize for their needs as long as they adhere to the license terms & conditions of the packages included.