Simple implementation laravel tenancy
php8+mysql8+node version 16 up
cp .env.example .envphp artisan key:generatecomposer i or composer installphp artisan migrate:freshnpm i or npm installnpm run dev- Update
.envAPP_DOMAIN to what you're using - Update
.envDB_ 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:installphp 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