Added more database fields for contacts. Worked on popovers in customers view. #3

This commit is contained in:
2025-11-04 15:17:23 +01:00
parent d222b4c10d
commit b27a1bd66d
5 changed files with 139 additions and 20 deletions
+28 -4
View File
@@ -21,16 +21,40 @@ public function definition()
}
$gender = rand(0, 9) >= 5 ? 'female' : 'male';
return [
$userName = $this->faker->userName();
$hasLinkedIn = rand(0, 9) >= 7;
$hasMatrix = rand(0, 9) >= 7;
$hasGithub = rand(0, 9) >= 7;
$contact = [
'is_primary' => $this->faker->boolean(30),
'salutation' => $this->faker->title($gender),
'first_name' => $this->faker->firstName($gender),
'last_name' => $this->faker->lastName($gender),
'job_title' => $this->faker->jobTitle(),
'email' => $this->faker->unique()->safeEmail(),
'phone' => $this->faker->phoneNumber(),
'position' => $this->faker->jobTitle(),
'is_primary' => $this->faker->boolean(30),
'mobile_phone' => $this->faker->phoneNumber(),
'avatar' => $avatar,
'online_accounts' => []
];
if ($hasLinkedIn) $contact[] = [
'platform' => 'linkedin',
'user_name' => $userName,
'url' => 'https://www.linkedin.com/in/' . $userName
];
if ($hasMatrix) $contact[] = [
'platform' => 'matrix',
'user_name' => $userName,
'url' => '@' . $userName . ':matrix.org'
];
if ($hasGithub) $contact[] = [
'platform' => 'github',
'user_name' => $userName,
'url' => 'https://www.github.com/' . $userName
];
return $contact;
}
}