33 lines
928 B
PHP
33 lines
928 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class RegistrasiSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$lastNomorAntrian = DB::table('registrasis')->max('nomor_antrian');
|
|
$nomorAntrianBaru = $lastNomorAntrian + 1; // Nomor antrian baru yang bertambah otomatis
|
|
|
|
DB::table('registrasis')->insert([
|
|
'pasien_id' => 1,
|
|
'pegawai_id' => 1,
|
|
'ruang_pelayanan_id' => 1,
|
|
'asuransi_id' => 1,
|
|
'nomor_kartu_asuransi' => '1234567890',
|
|
'tanggal_registrasi' => Carbon::today(),
|
|
'nomor_antrian' => $nomorAntrianBaru,
|
|
'status' => 'menunggu', // contoh status
|
|
'keluhan' => 'Sakit kepala',
|
|
]);
|
|
}
|
|
}
|