/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     User::truncate();
     Staff::truncate();
     Student::truncate();
     StudentNumber::truncate();
     StaffNumber::truncate();
     $user = ['first_name' => 'Jose Antonio', 'last_name' => 'Sinadinse', 'fullname' => '', 'password' => \Hash::make('password'), 'email' => '*****@*****.**', 'address' => 'Pretoria', 'cellnumber' => '000000000', 'user_type_id' => 1, 'state_id' => 1];
     if (StaffNumber::all()->count() == 0) {
         $stfnum = StaffNumber::create(["number" => 2000, "date" => date("Y-m-d")]);
     } else {
         $lateststfnum = StaffNumber::all()->last();
         $stfnum = StaffNumber::create(["number" => $lateststfnum->number + 1, "date" => date("Y-m-d")]);
     }
     $staff = Staff::create(['staff_number' => $stfnum->number]);
     $user = $staff->user()->create($user);
     $user->addPermission('admin');
     for ($i = 3; $i < 20; $i++) {
         $user = ['first_name' => 'Name' . $i, 'last_name' => 'Surname' . $i, 'fullname' => '', 'password' => \Hash::make('aleluia'), 'email' => 'josebarros' . $i . '@hotmail.com', 'address' => 'Pretoria', 'cellnumber' => '00000000' . $i, 'user_type_id' => 3, 'state_id' => 1];
         if (StudentNumber::all()->count() == 0) {
             $stdnum = StudentNumber::create(["number" => 200000000, "date" => date("Y-m-d")]);
         } else {
             $lateststdnum = StudentNumber::all()->last();
             $stdnum = StudentNumber::create(["number" => $lateststdnum->number + 1, "date" => date("Y-m-d")]);
         }
         $student = Student::create(['student_number' => $stdnum->number, "university_id" => 1, "faculty_id" => '', "department_id" => '', "course_id" => '']);
         $user = $student->user()->create($user);
         $user->addPermission('student');
     }
 }