Simple implementation laravel tenancy
php8+
mysql8+
node version 16 up
cp .env.example .env
php artisan key:generate
composer i or composer install
php artisan migrate:fresh
npm i or npm install
npm run dev
- Update
.env
APP_DOMAIN to what you're using - Update
.env
DB_ configurations
- You need to make sure the custom domain is included in
config/tenancy.php > ln:19 central_domains
- just run
php artisan main:create-user {username} {password?}
- this command will help you create a master user where you can add tenants
php artisan tenancy:install
php artisan app:create-tenant {domain} {admin-email?} {admin-password?}
- First argument is for domain name to be used
- Second argument is for admin username
- Third argument is for admin password
- The command above creates a tenant with admin account to be used during login