A full-featured multi-tenant app with Laravel Part 1 β Setup
Part 0, Part 1 π, Part 2, Part3, Part4, Part 5, Part 6, Part 7
In this part weβll accomplish the following tasks:
β Create a project
β Setup a system database and a user
β Install and configure multi-tenant package
β Add an artisan command to create a tenant
β Add an artisan command to delete a tenant
1. Create a new Laravel project
Letβs get started by actually creating a new Laravel project. This is easy:
$ laravel new townhouse
2. Set up a system database
Just like with most any other web apps, townhouse is going to need a database and a database user. But unlike most other web apps this database user is going to be a bit different. Because our app will create 1 database for each tenant, our database user needs special privileges to do so.
Note: The following step for creating a database and a user is only applicable to MacOS+SequelPro users but you should be able to perform these on your choice of OS and your choice of MySQL client in the similar fashion.