/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     $programIds = Program::lists('id')->all();
     foreach ($programIds as $programId) {
         for ($l = 0; $l < 5; $l++) {
             DB::table('program_levels')->insert(['program_id' => $programId, 'name' => $faker->safeColorName(), 'created_at' => Carbon::now()]);
         }
     }
 }
Example #2
0
 /**
  * Show the application registration form.
  *
  * @return Response
  */
 public function getRegister()
 {
     // if ($this->agent->roles() == "Administrator")
     // {
     $roles = Role::lists('name', 'id');
     $programs = Program::lists('name', 'id');
     return view('auth.register', compact('roles', 'programs'));
     // }
     // else{
     //    return view('errors.unauth');
     // }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     $attendeeIds = Attendee::lists('id')->all();
     $programIds = Program::lists('id')->all();
     $counter = 0;
     foreach ($attendeeIds as $attendeeId) {
         $completion_date = $termination_date = NULL;
         if (($counter + 1) % 6 == 0) {
             $completion_date = $faker->dateTimeBetween($startDate = '-6 months');
         } else {
             if (($counter + 1) % 13 == 0) {
                 $termination_date = $faker->dateTimeBetween($startDate = '-6 months');
             }
         }
         DB::table('enrollments')->insert(['attendee_id' => $attendeeId, 'program_id' => $faker->randomElement($programIds), 'start_date' => $faker->dateTimeBetween($startDate = '-12 months'), 'completion_date' => $completion_date, 'termination_date' => $termination_date, 'created_at' => Carbon::now()]);
         $counter++;
     }
 }
Example #4
0
 public function createFromTemp($id)
 {
     $programs = Program::lists('name', 'id');
     $client = Temp::findOrFail($id);
     return view('clients.fromTemp', compact('client', 'programs'));
 }