public function run()
 {
     $faker = Faker\Factory::create();
     for ($id = 1; $id < 19; $id++) {
         CommonId::create(['user_id' => $id, 'tin' => $faker->randomElement(['646933026598', '532069354265', '123465987567']), 'philhealth' => $faker->randomElement(['646945126330', '566265320695', '123596234567']), 'pagibig' => $faker->randomElement(['646365989330', '532365980695', '123365984567']), 'sss' => $faker->randomElement(['646933659830', '532063215695', '123365984567'])]);
     }
 }
 public function postRegister()
 {
     $validator = Validator::make(Input::all(), User::$rules);
     if ($validator->fails()) {
         return Redirect::route('register')->withErrors($validator)->withInput();
     }
     $user = User::create(['firstname' => Input::get('firstname'), 'middlename' => Input::get('middlename'), 'lastname' => Input::get('lastname'), 'email' => Input::get('email'), 'username' => Input::get('username'), 'password' => Hash::make(Input::get('password')), 'department_id' => Input::get('department_id'), 'birthday' => Input::get('birthday'), 'birthplace' => Input::get('birthplace'), 'gender' => Input::get('gender'), 'civilstatus' => Input::get('civilstatus'), 'citizenship' => Input::get('citizenship'), 'height' => Input::get('height'), 'weight' => Input::get('weight'), 'bloodtype' => Input::get('bloodtype'), 'datehired' => Input::get('datehired'), 'pos_id' => Input::get('pos_id'), 'status' => Input::get('status')]);
     // $user->department()->attach(Input::get('department_id'));
     $lastid = User::orderBy('id', 'desc')->first();
     $contacts = ContactInfo::create(['user_id' => $lastid->id, 'homenum' => Input::get('homenum'), 'officenum' => Input::get('officenum'), 'mobilenum' => Input::get('mobilenum'), 'street' => Input::get('street'), 'city' => Input::get('city')]);
     $commonid = CommonId::create(['user_id' => $lastid->id, 'tin' => input::get('taxid'), 'philhealth' => input::get('philhealth'), 'pagibig' => input::get('pagibig'), 'sss' => input::get('sss'), 'gsisbp' => input::get('gsisbp'), 'gsispolicy' => input::get('gsispol'), 'gsisoptional' => input::get('gsisopt'), 'educplan' => input::get('educplan')]);
     $father = Parents::create(['user_id' => $lastid->id, 'parent_id' => Input::get('fatherid'), 'firstname' => Input::get('fatherfirstname'), 'middlename' => Input::get('fathermiddlename'), 'lastname' => Input::get('fatherlastname'), 'address' => Input::get('fatheraddress')]);
     $mother = Parents::create(['user_id' => $lastid->id, 'parent_id' => Input::get('motherid'), 'firstname' => Input::get('motherfirstname'), 'middlename' => Input::get('mothermiddlename'), 'lastname' => Input::get('motherlastname'), 'address' => Input::get('motheraddress')]);
     $vacleave = LeaveBalance::create(['user_id' => $lastid->id, 'balance' => 1.25, 'leavetype_id' => 1]);
     $sickleave = LeaveBalance::create(['user_id' => $lastid->id, 'balance' => 1.25, 'leavetype_id' => 2]);
     $patleave = LeaveBalance::create(['user_id' => $lastid->id, 'leavetype_id' => 3]);
     $patleave = LeaveBalance::create(['user_id' => $lastid->id, 'leavetype_id' => 4]);
     $birthleave = LeaveBalance::create(['user_id' => $lastid->id, 'leavetype_id' => 5]);
     $school = School::create(['user_id' => $lastid->id]);
     $evalpoints = EvaluatePoints::create(['user_id' => $lastid->id]);
     $audit = AuditTrail::create(['user_id' => Auth::id(), 'role' => 'Employee Management Admin', 'action' => 'registered a new EMPLOYEE "' . $lastid->firstname . ' ' . $lastid->lastname . '".']);
     return Redirect::route('register')->with('alert', 'success|' . $user->formatName(':fn :mi :ln') . ' has been registered successfully.');
 }