database/seeds/PasiensSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $antrian = $this->getAntrian();
        $faker = Faker::create('id_ID');
        for ($i = 1; $i <= 50; $i++) {
            DB::table('pasiens')->insert([
                'name' => $faker->name,
                'address' => $faker->address,
                'keluhan' => $faker->word,
                'antrian_id' => $antrian,
                'jamkes_id' => $faker->numberBetween(1, 1),
                'dokter_id' => $faker->numberBetween(1, 1),
            ]);
        }
    }
public function run ( ) { $ antrian = $ this -> getAntrian ( ) ; $ faker = Faker :: create ( 'id_ID' ) ; for ( $ i = 1 ; $ i <= 50 ; $ i ++ ) { DB :: table ( 'pasiens' ) -> insert ( [ 'name' => $ faker -> name , 'address' => $ faker -> address , 'keluhan' => $ faker -> word , 'antrian_id' => $ antrian , 'jamkes_id' => $ faker -> numberBetween ( 1 , 1 ) , 'dokter_id' => $ faker -> numberBetween ( 1 , 1 ) , ] ) ; } }
Run the database seeds.
Run the database seeds .
// $faker = Faker::create('id_ID'); // for ($i = 1; $i <= 100; $i++) { //     DB::table('pasiens')->insert([ //         'name' => $faker->name, //         'address' => $faker->address, //         'antrian_id' => $antrian, //         'dokter_id' => $faker->numberBetween(1, 1), //         'keluhan' => $faker->word, //         'jamkes_id' => $faker->numberBetween(1, 1) //     ]); // } // insert data ke table pegawai menggunakan Faker