Local Demo Data (Development Only)
Populate a dedicated demo workspace with realistic CRM data for local development, manual QA, UI validation, and dashboard demonstrations.
Never run this in production. The Artisan command aborts immediately when APP_ENV=production.
Prerequisites
- Migrate and seed the central platform (local also creates the demo workspace):
php artisan migrate:fresh --seedOr migrate + central seed only, then demo separately:
php artisan migrate
php artisan db:seed --class=Database\\Seeders\\Central\\CentralDatabaseSeeder
php artisan local:seed-demo- Ensure
APP_ENV=localin.env.
Quick start
php artisan migrate:fresh --seed
# or, if central is already seeded:
php artisan local:seed-demo
# full cross-module story (modules + reports + linked CRM/billing/support data):
php artisan local:seed-demo --fullThis will:
- Create the Demo CRM Workspace tenant (if it does not exist)
- Seed demo users, leads, tasks, notes, follow-ups, activities, and notifications
- Print login credentials and record counts
Demo workspace credentials
| Field | Value |
|---|---|
| Domain | demo-crm.localhost |
| Owner email | demo@demo.com |
| Password | password |
Additional demo users use {slug}@demo-crm.local with the same password.
Configure these values in config/local-demo.php.
In the SPA (npm run dev), /login prefills demo@demo.com / password and /central/login prefills the central superadmin. Playwright tenant suites sign in to this same workspace via E2E_DEMO_* (see Frontend .env.e2e.example).
Dataset sizes
Use --size to control volume:
| Size | Users | Leads | Tasks |
|---|---|---|---|
small | 8 | 50 | 25 |
medium (default) | 25 | 500 | 300 |
large | 30 | 2,000 | 1,000 |
php artisan local:seed-demo --size=small
php artisan local:seed-demo --size=large
php artisan local:seed-demo --full --size=smallFull demo (--full)
Pass --full to opt into a richer local workspace:
- Installs the modules listed in
config/local-demo.php→demo_modules(Companies, Contacts, Opportunities, Invoices, Help Desk, Knowledge Base, Analytics, and related bundles). - Seeds the standard CRM dataset (
--sizestill applies). - Chains
LocalReportsDemoDataServicefor Reports KPI rows. - Adds a cross-module story: Companies/Contacts linked to Leads, a sales→billing chain (Opportunity → Quotation → Contract → Invoice → Payment), and a Help Desk ticket linked to a Knowledge Base article.
--full defaults off so existing local:seed-demo runs stay CRM-only.
php artisan local:seed-demo --full
php artisan local:seed-demo --full --fresh --size=mediumReset demo data
Use --fresh to wipe CRM demo data for the target workspace before re-seeding. You will be prompted to confirm.
php artisan local:seed-demo --fresh
php artisan local:seed-demo --size=medium --freshThe reset removes:
- Demo users (
*@demo-crm.local, except the owner) - All leads, tasks, and related notes, follow-ups, activities, and assignment history
- Demo notifications
- When
--fullwas used with--fresh, cross-module entities (companies, contacts, opportunities, invoices, help desk, knowledge base, projects, vendors, purchase orders, expenses)
It does not delete the workspace, billing records, or central platform data.
Seed an existing workspace
To seed a different tenant instead of the default demo workspace:
php artisan local:seed-demo --tenant=your-workspace-slugStaging (explicit opt-in only)
Demo seeders refuse to run outside the local environment unless you pass:
php artisan local:seed-demo --force-local-demoProduction always aborts, even with --force-local-demo.
What gets seeded
Users
- Keeps the workspace owner (
superadmin) - Adds 7–29 demo users with realistic names and job titles
- Assigns existing RBAC roles:
manager,admin,staff - Varies suspension status and account age
Leads
- Weighted pipeline distribution (New → Won/Lost)
- Realistic lead values ($100 – $150k+)
- Notes, follow-ups (today, overdue, completed), activity timelines, assignment history
Tasks
- Mixed statuses, priorities, and due dates (overdue, today, next week, future)
- Comments (task notes) and activity timelines
Dashboard widgets
Seeded data supports:
- Pipeline overview and revenue sparkline
- Lead sources
- Today's / overdue follow-ups
- Upcoming / overdue tasks
- Activity feed and notifications
Architecture
| Component | Path |
|---|---|
| Artisan command | app/Console/Commands/LocalSeedDemoCommand.php |
| Config | config/local-demo.php |
| Master seeder | database/seeders/Local/LocalDevelopmentSeeder.php |
| Child seeders | TenantUsersSeeder, LeadsSeeder, TasksSeeder, TodosSeeder, DemoNotificationsSeeder |
| Services | app/Services/Local/LocalDemoDataService.php, LocalDemoTenantService.php, LocalReportsDemoDataService.php, LocalDemoCrossModuleStoryService.php |
Demo seeders are not registered in DatabaseSeeder or TenantDatabaseSeeder.
Tests
php artisan test --compact tests/Feature/Local/LocalSeedDemoCommandTest.phpPlaywright
Existing Playwright tests self-provision workspaces and do not depend on demo seeders. Use demo data for manual QA and local UI exploration only.