Skip to content

Tenant Management Commands

Commands to create and manage tenants.

Creates a new tenant with interactive prompts.

Terminal window
php artisan tenancy:create
Terminal window
# Create with full domain
php artisan tenancy:create "Acme Corp" --domain="acme.com"
# Create with subdomain
php artisan tenancy:create "Acme Corp" --subdomain="acme"
# Create with all options
php artisan tenancy:create "Acme Corp" \
--subdomain="acme" \
--database="acme_db" \
--plan="premium" \
--active \
--expires="2025-12-31"
  • --domain=DOMAIN - Tenant’s full domain
  • --subdomain=SUBDOMAIN - Tenant’s subdomain
  • --database=NAME - Database name
  • --plan=SLUG - Plan slug
  • --active - Mark as active
  • --inactive - Mark as inactive
  • --expires=DATE - Expiration date

Lists all tenants in the system.

Terminal window
php artisan tenancy:list

Deletes a tenant and all its information.

Terminal window
php artisan tenancy:delete {tenant}
# With options
php artisan tenancy:delete my-tenant --delete-database --force
  • --force - Skip confirmation prompt
  • --delete-database - Also delete tenant database

Creates a user for a specific tenant with roles and permissions.

Terminal window
# Interactive mode
php artisan tenant:user-create
# Non-interactive mode
php artisan tenant:user-create \
--tenant="my-tenant" \
--name="John Doe" \
--email="john@example.com" \
--role="admin"
  • --tenant=SLUG - Tenant ID or slug
  • --name=NAME - User name
  • --email=EMAIL - User email
  • --password=PASSWORD - Password (auto-generated if not provided)
  • --role=SLUG - Role slug
  • --permissions=LIST - Comma-separated list of permissions
  • --list-tenants - List all tenants
  • --list-roles - List available roles
  • --list-permissions - List available permissions