database/seeds/EmployeeTableSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        for ($i = 0; $i < 20; $i++) {
            $faker = Faker\Factory::create();
            $employee = new \App\Employee();
            $employee->name = $faker->name;
            $employee->dob = $faker->date("d/m/Y");
            $employee->gender = $faker->numberBetween(1, 3);
            $employee->phone = '(0)' . rand(900000001, 999999999);
            $employee->socialID = $faker->numberBetween(111111, 999999);
            $employee->email = $faker->companyEmail;
            $employee->address = $faker->address;
            $employee->group_id = $faker->numberBetween(1, 6);
            $employee->save();
            $i++;
        }
    }
public function run ( ) { for ( $ i = 0 ; $ i < 20 ; $ i ++ ) { $ faker = Faker \ Factory :: create ( ) ; $ employee = new \ App \ Employee ( ) ; $ employee -> name = $ faker -> name ; $ employee -> dob = $ faker -> date ( " d/m/Y " ) ; $ employee -> gender = $ faker -> numberBetween ( 1 , 3 ) ; $ employee -> phone = '(0)' . rand ( 900000001 , 999999999 ) ; $ employee -> socialID = $ faker -> numberBetween ( 111111 , 999999 ) ; $ employee -> email = $ faker -> companyEmail ; $ employee -> address = $ faker -> address ; $ employee -> group_id = $ faker -> numberBetween ( 1 , 6 ) ; $ employee -> save ( ) ; $ i ++ ; } }
Run the database seeds.
Run the database seeds .