deploy commit
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Account>
|
||||
*/
|
||||
class AccountFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected static ?string $password;
|
||||
public function definition(): array
|
||||
{
|
||||
$role = $this->faker->randomElement(['patient', 'doctor']);
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'phone' => fake()->phoneNumber(),
|
||||
'dob' => fake()->date(),
|
||||
'role' => $role,
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
];
|
||||
}
|
||||
|
||||
public function patient() {
|
||||
return $this->state([
|
||||
'role' => 'patient'
|
||||
]);
|
||||
}
|
||||
|
||||
public function doctor() {
|
||||
return $this->state([
|
||||
'role' => 'doctor'
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Account;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\DoctorProfile>
|
||||
*/
|
||||
class DoctorProfileFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'user_id' => Account::where('role', 'doctor')->inRandomOrder()->first()->id,
|
||||
'specialization' => $this->faker->randomElement(['Dermatology', 'General Medicine']),
|
||||
'license_number' => $this->faker->bothify('LIC-####'),
|
||||
'license_file_path' => $this->faker->imageUrl(),
|
||||
'diploma_file_path' => $this->faker->imageUrl(),
|
||||
'certification' => $this->faker->sentence,
|
||||
'current_institution' => $this->faker->company,
|
||||
'years_of_experience' => $this->faker->numberBetween(1, 30),
|
||||
'work_history' => $this->faker->paragraph,
|
||||
'publications' => $this->faker->sentence,
|
||||
];
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Account;
|
||||
use App\Models\Submission;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Submission>
|
||||
*/
|
||||
class SubmissionFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
protected $model = Submission::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'patient_id' => Account::where('role', 'patient')->inRandomOrder()->first()->id,
|
||||
'doctor_id' => Account::where('role', 'doctor')->inRandomOrder()->first()->id,
|
||||
'image_path' => $this->faker->imageUrl(),
|
||||
'complaint' => $this->faker->sentence,
|
||||
'status' => $this->faker->randomElement(['pending', 'verified', 'rejected']),
|
||||
'diagnosis' => $this->faker->randomElement(['Melanoma', 'Eczema', 'Psoriasis']),
|
||||
'doctor_note' => $this->faker->sentence,
|
||||
'submitted_at' => $this->faker->dateTime(),
|
||||
'verified_at' => now(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
|
||||
*/
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The current password being used by the factory.
|
||||
*/
|
||||
protected static ?string $password;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'remember_token' => Str::random(10),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the model's email address should be unverified.
|
||||
*/
|
||||
public function unverified(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Verification>
|
||||
*/
|
||||
class VerificationFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user