Remove Faker from DemoTenantSeeder for --no-dev prod seeds.
Deploy Ladill Care / deploy (push) Successful in 1m51s

DemoWorld seeding already used deterministic catalogs; the last randomElement calls blocked production demo:seed without fakerphp/faker.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-17 14:11:51 +00:00
co-authored by Cursor
parent dd4efec135
commit 1da90203e8
+8 -17
View File
@@ -27,8 +27,6 @@ use App\Models\User;
use App\Models\Visit;
use App\Models\VitalSign;
use App\Support\DemoWorld;
use Faker\Factory as FakerFactory;
use Faker\Generator as Faker;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
@@ -97,17 +95,14 @@ class DemoTenantSeeder
}
return DB::transaction(function () use ($user, $ownerRef, $plan, $volumes) {
$faker = FakerFactory::create();
$faker->seed(crc32($ownerRef.'|'.$plan));
$organization = $this->upsertOrganization($user, $ownerRef, $plan, $volumes['branches']);
$this->upsertOwnerMember($organization, $ownerRef);
$branches = $this->seedBranches($organization, $ownerRef, $volumes, $faker);
$branches = $this->seedBranches($organization, $ownerRef, $volumes);
$this->seedStaffMembers($organization, $ownerRef, $plan, $branches);
$departments = $this->seedDepartments($branches, $ownerRef, $volumes);
$practitioners = $this->seedPractitioners($organization, $branches, $departments, $ownerRef, $volumes, $faker);
$patients = $this->seedPatients($organization, $branches, $ownerRef, $volumes, $faker);
$practitioners = $this->seedPractitioners($organization, $branches, $departments, $ownerRef, $volumes);
$patients = $this->seedPatients($organization, $branches, $ownerRef, $volumes);
$appointmentCount = $this->seedAppointmentsAndClinical(
$organization,
$branches,
@@ -116,7 +111,6 @@ class DemoTenantSeeder
$patients,
$ownerRef,
$volumes,
$faker,
);
if ($volumes['paid_modules']) {
@@ -127,7 +121,6 @@ class DemoTenantSeeder
$patients,
$ownerRef,
$volumes,
$faker,
);
}
@@ -357,7 +350,7 @@ class DemoTenantSeeder
* @param array<string, mixed> $volumes
* @return list<Branch>
*/
private function seedBranches(Organization $organization, string $ownerRef, array $volumes, Faker $faker): array
private function seedBranches(Organization $organization, string $ownerRef, array $volumes): array
{
$catalog = DemoWorld::branches($this->normalizePlan(
(string) data_get($organization->settings, 'plan', 'free')
@@ -460,7 +453,6 @@ class DemoTenantSeeder
array $departments,
string $ownerRef,
array $volumes,
Faker $faker,
): array {
$practitioners = [];
for ($i = 0; $i < $volumes['practitioners']; $i++) {
@@ -500,7 +492,6 @@ class DemoTenantSeeder
array $branches,
string $ownerRef,
array $volumes,
Faker $faker,
): array {
$worldPeople = DemoWorld::people();
$patients = [];
@@ -566,7 +557,6 @@ class DemoTenantSeeder
array $patients,
string $ownerRef,
array $volumes,
Faker $faker,
): int {
$statuses = [
Appointment::STATUS_SCHEDULED,
@@ -576,6 +566,8 @@ class DemoTenantSeeder
Appointment::STATUS_COMPLETED,
Appointment::STATUS_CANCELLED,
];
$reasons = ['Follow-up', 'New complaint', 'Review labs', 'Chronic care'];
$symptoms = ['Fever', 'Cough', 'Headache', 'Fatigue'];
$count = 0;
for ($i = 0; $i < $volumes['appointments']; $i++) {
@@ -629,7 +621,7 @@ class DemoTenantSeeder
'cancelled_at' => $status === Appointment::STATUS_CANCELLED
? $scheduledAt->copy()->subHour()
: null,
'reason' => $faker->randomElement(['Follow-up', 'New complaint', 'Review labs', 'Chronic care']),
'reason' => $reasons[$i % count($reasons)],
'created_by' => $ownerRef,
'deleted_at' => null,
],
@@ -645,7 +637,7 @@ class DemoTenantSeeder
'practitioner_id' => $practitioner->id,
'patient_id' => $patient->id,
'status' => Consultation::STATUS_COMPLETED,
'symptoms' => $faker->randomElement(['Fever', 'Cough', 'Headache', 'Fatigue']),
'symptoms' => $symptoms[$i % count($symptoms)],
'clinical_notes' => 'Demo consultation notes.',
'started_at' => $scheduledAt->copy()->addMinutes(15),
'completed_at' => $scheduledAt->copy()->addHour(),
@@ -693,7 +685,6 @@ class DemoTenantSeeder
array $patients,
string $ownerRef,
array $volumes,
Faker $faker,
): void {
$types = [];
foreach ([