migration appointment & seeder

This commit is contained in:
Muhammad Fajar
2022-11-04 09:54:08 +07:00
parent 975f6cec35
commit 4b4104bc6b
5 changed files with 181 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class AppointmentTypesSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$codes = ['ROUTINE', 'WALKIN', 'CHECKUP', 'FOLLOWUP', 'EMERGENCY', 'TELECONSULTATION'];
$names = ['Routine', 'Walk In', 'Check-Up', 'Follow Up', 'Emergency', 'Teleconsultation'];
$descriptions = ['Routine Appointment', 'A previously unscheduled walk-in visit', 'A routine check-up, such as an annual physical', 'A follow up visit from a previous appointment', 'Emergency appointment', 'Teleconsultation appointment'];
for ($i = 0; $i < count($codes); $i++) {
DB::table('appointment_types')->insert([
'code' => $codes[$i],
'name' => $names[$i],
'description' => $descriptions[$i]
]);
}
}
}