initial commit

This commit is contained in:
Debian
2026-06-03 04:18:36 +07:00
commit a5569ce2a0
220 changed files with 30797 additions and 0 deletions
@@ -0,0 +1,43 @@
<?php
namespace Database\Factories;
use App\Models\Consultation;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Consultation>
*/
class ConsultationFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Consultation::class;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
// Get a random patient from the users table
$patient = User::where('user_role', 'user')->inRandomOrder()->first();
// Get a random doctor from the users table
$doctor = User::where('user_role', 'doctor')->inRandomOrder()->first();
return [
'patient_id' => $patient->id,
'doctor_id' => $doctor->id,
'consultation_date' => $this->faker->dateTimeBetween('-1 year', '+1 year')->format('Y-m-d'),
'consultation_time' => $this->faker->time('H:i:s'),
'location' => $this->faker->city,
'consultation_status' => $this->faker->randomElement(['pending', 'declined', 'approved', 'finished']),
];
}
}