Tenant Management Commands
Tenant Management Commands
Section titled “Tenant Management Commands”Commands to create and manage tenants.
tenancy:create
Section titled “tenancy:create”Creates a new tenant with interactive prompts.
php artisan tenancy:createNon-Interactive Mode
Section titled “Non-Interactive Mode”# Create with full domainphp artisan tenancy:create "Acme Corp" --domain="acme.com"
# Create with subdomainphp artisan tenancy:create "Acme Corp" --subdomain="acme"
# Create with all optionsphp artisan tenancy:create "Acme Corp" \ --subdomain="acme" \ --database="acme_db" \ --plan="premium" \ --active \ --expires="2025-12-31"Options
Section titled “Options”--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
tenancy:list
Section titled “tenancy:list”Lists all tenants in the system.
php artisan tenancy:listtenancy:delete
Section titled “tenancy:delete”Deletes a tenant and all its information.
php artisan tenancy:delete {tenant}
# With optionsphp artisan tenancy:delete my-tenant --delete-database --forceOptions
Section titled “Options”--force- Skip confirmation prompt--delete-database- Also delete tenant database
tenant:user-create
Section titled “tenant:user-create”Creates a user for a specific tenant with roles and permissions.
# Interactive modephp artisan tenant:user-create
# Non-interactive modephp artisan tenant:user-create \ --tenant="my-tenant" \ --name="John Doe" \ --email="john@example.com" \ --role="admin"Options
Section titled “Options”--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