Skip to content

Test Accounts

Quick reference for logging in as different roles on local/stage environments without bothering an engineer for credentials.

How to seed

On a local or stage environment:

bash
php artisan migrate:fresh --seed

For a complete setup that also wires up roles, permissions, and role assignments (recommended — see note below):

bash
php artisan app:setup

Important: The seeders create users but do not assign Spatie roles. The app:setup command runs the seeders and then calls roles:setup, permissions:setup, members:assign-roles, and admins:assign-roles to wire everything up. If you only run db:seed, the seeded admin accounts will exist but won't have their roles attached, and role-gated endpoints/Filament panels will reject them.

Production never runs seeders. app:setup is hard-blocked in the production environment.

Default accounts (after seeding)

All three admin accounts are created by UserSeeder with the literal password password. Role assignment happens via php artisan admins:assign-roles (run automatically by app:setup).

RoleEmailPasswordWhat they can do
OTC_ONE_ADMINsuperadmin@easyotc.compasswordSuper admin — full access across all carriers, Filament admin panel, manage users/products/carriers
CARRIER_ADMINcarrier.admin@easyotc.compasswordManage their own carrier (WellCare by default) — products, members, agents, orders
AGENTagent@easyotc.compasswordCustomer-service role — view/assist members, handle issues

All three are linked to carrier_id = 1 (WellCare — the only carrier created by CarrierSeeder).

Member accounts

MemberSeeder creates members via Member::factory() — emails and passwords come from the factory:

  • Emails: random fake()->unique()->safeEmail() (different on every seed run)
  • Password: 'password' (set by UserFactory default — same literal for every factory user)
  • Member codes: MEMBER001 and MEMBER002 are explicit; the rest are auto-generated MEMBER####
  • MEMBER001 has DOB 01-01-2025 and gets explicit shipping + billing addresses

To find the seeded member emails after running db:seed:

bash
php artisan tinker
>>> \App\Models\Member::with('user')->get()->pluck('user.email', 'code');

Use password as the password for any of them (factory default).

Additional random users

UserSeeder also creates User::factory(10)->create() — 10 extra users with random emails and password password. These have no role assigned and no associated Member record.

How to create a new admin manually

If you need a personal admin account on stage:

bash
php artisan tinker
php
$user = \App\Models\User::factory()->create([
    'first_name' => 'Admin',
    'last_name'  => 'Tester',
    'email'      => 'pujen@easyotc.com',
    'password'   => \Hash::make('whatever-you-want'),
    'email_verified_at' => now(),
    'carrier_id' => 1,
]);
$user->assignRole(\App\Enums\RoleEnum::OTC_ONE_ADMIN->value);

Swap OTC_ONE_ADMIN for CARRIER_ADMIN, AGENT, or MEMBER as needed. Role values live in app/Enums/RoleEnum.php.

If assignRole throws "role does not exist", run php artisan roles:setup first.

Test credit cards (Stripe)

Stripe integration is in progress (see docs/in-progress.md). These test card numbers only work once Stripe is wired up in stage and you're using Stripe test-mode keys:

ScenarioCard numberNotes
Success4242 4242 4242 4242Use any future expiry, any CVC, any ZIP
Generic decline4000 0000 0000 0002Card declined
Insufficient funds4000 0000 0000 9995Decline with insufficient_funds
3DS required4000 0027 6000 3184Triggers 3D Secure authentication challenge
Expired card4000 0000 0000 0069Decline with expired_card

Full list: https://docs.stripe.com/testing#cards

Test WEX card

Not present in the codebase. WEX/FSA/HSA test BINs are issued by WEX directly per partner — ask the engineer who set up the WEX integration (or check the WEX sandbox docs once we have a sandbox account). TBD.

Test products

ProductSeeder is commented out in DatabaseSeeder (see line 20 of database/seeders/DatabaseSeeder.php), so a default db:seed does not create any products. Only ProductImageSeeder runs.

If you need products to test the catalog/cart/checkout flow, run the product seeder manually:

bash
php artisan db:seed --class=ProductSeeder

This creates ~45 products (mix of in-stock, out-of-stock, prescription, OTC) with random SKUs in the format XX-####-XX (e.g. AB-1234-CD) — there are no fixed test SKUs to memorize. List a few after seeding:

bash
php artisan tinker
>>> \App\Models\Product::take(10)->pluck('sku', 'name');

Categories created by the seeder: NSAIDs, Opioids, Antibiotics, Antihistamines, Antacids, Proton Pump Inhibitors, Sleep Aids, Pain Relief, Allergy Relief, Digestive Health, Tablet, Capsule, Liquid, Cream, Gel, Patch (and more).

Resetting the stage DB

Destructive — wipes all data. Engineer-only. Use when test data gets confusing or you want a clean slate:

bash
php artisan migrate:fresh --seed --force

Or the full setup (recommended, since it also assigns roles):

bash
php artisan app:setup --force

Both are blocked in production. After running, the default accounts above are restored with password password.