/**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('goals')->insert([['name' => 'Transform Communities', 'bpid' => 2, 'group' => 1, 'bp' => true], ['name' => 'Evolve our Digital Environment', 'bpid' => 2, 'group' => 1, 'bp' => true], ['name' => 'Act as a catalyst for learning, discovery, and creating', 'bpid' => 2, 'group' => 1, 'bp' => true], ['name' => 'Evolve the EPL brand', 'bpid' => 2, 'group' => 3, 'bp' => true], ['name' => 'Transition the way we do Business', 'bpid' => 1, 'group' => 1, 'bp' => true], ['name' => 'Develop Better Customer Service', 'bpid' => 1, 'group' => 2, 'bp' => true], ['name' => 'IT Services Departmental Goals', 'bpid' => 2, 'group' => 1, 'bp' => false]]);
     for ($i = 1; $i <= App\Goal::All()->Count(); $i++) {
         DB::table('goals')->where('id', $i)->update(array('ident' => $i));
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('objectives')->insert([['name' => 'We Identify and meet community needs', 'goal_id' => 1, 'group' => 1], ['name' => 'We Reduce barriers to accessing library services', 'goal_id' => 1, 'group' => 1], ['name' => 'Online services are highly used and valued', 'goal_id' => 2, 'group' => 1], ['name' => 'Together with our community we provide successful, meaningful services that are highly rates and heavily used', 'goal_id' => 1, 'group' => 2], ['name' => 'Edmontonians view EPL as integral to their lifelong formal and informal learning.', 'goal_id' => 3, 'group' => 2], ['name' => 'Promote upcoming technology', 'goal_id' => 2, 'group' => 3], ['name' => 'Increase eBook availability', 'goal_id' => 2, 'group' => 7], ['name' => 'Design new EPL logo for 2017', 'goal_id' => 4, 'group' => 3], ['name' => 'Entice high end speakers to come at no or low cost', 'goal_id' => 5, 'group' => 4], ['name' => 'Incentives for employees with good service', 'goal_id' => 6, 'group' => 5], ['name' => 'Entice high end speakers to come at no or low cost', 'goal_id' => 5, 'group' => 4], ['name' => 'Incentives for employees with good service', 'goal_id' => 6, 'group' => 5], ['name' => 'Upgrade IT software and hardware', 'goal_id' => 7, 'group' => 1], ['name' => 'Improve IT related services', 'goal_id' => 7, 'group' => 1]]);
     //Generate Idents for Objectives.
     for ($j = 1; $j <= App\Goal::All()->Count(); $j++) {
         global $goal;
         $goal = DB::table('goals')->where('id', $j)->first();
         for ($i = 1, $k = 1; $i <= App\Objective::All()->Count(); $i++) {
             $obj = DB::table('objectives')->where('id', $i)->first();
             if ($obj->goal_id == $goal->id) {
                 DB::table('objectives')->where('id', $i)->update(array('ident' => $j . '.' . $k));
                 $k++;
             }
         }
     }
 }
Exemple #3
0
    return ['user_id' => $faker->randomElement($usrArray), 'category_id' => $faker->randomElement($ctgArray), 'description' => $faker->paragraph];
});
$factory->define(App\SocialActivity::class, function (Faker\Generator $faker) {
    $usrArray = App\User::all()->lists('id')->toArray();
    $act = ['followed', 'unfollowed'];
    return ['subject_id' => $faker->randomElement($usrArray), 'object_id' => $faker->randomElement($usrArray), 'activity' => $faker->randomElement($act)];
});
$factory->define(App\Recruitment::class, function (Faker\Generator $faker) {
    $prjArray = App\Project::all()->lists('id')->toArray();
    return ['project_id' => $faker->randomElement($prjArray)];
});
$factory->define(App\Roadmap::class, function (Faker\Generator $faker) {
    $prjArray = App\Project::all()->lists('id')->toArray();
    return ['project_id' => $faker->randomElement($prjArray), 'description' => $faker->paragraph];
});
$factory->define(App\Goal::class, function (Faker\Generator $faker) {
    $rdmArray = App\Roadmap::all()->lists('id')->toArray();
    return ['roadmap_id' => $faker->randomElement($rdmArray), 'description' => $faker->paragraph];
});
$factory->define(App\Task::class, function (Faker\Generator $faker) {
    //masih harus diubah spy dapetnya cmn user yg terlibat ke project
    $usrArray = App\User::all()->lists('id')->toArray();
    $glArray = App\Goal::all()->lists('id')->toArray();
    $status = ['Completed', 'Ongoing'];
    return ['goal_id' => $faker->randomElement($glArray), 'user_id' => $faker->randomElement($usrArray), 'status' => $faker->randomElement($status)];
});
$factory->define(App\RecruitmentTransaction::class, function (Faker\Generator $faker) {
    $rcArray = App\Recruitment::all()->lists('id')->toArray();
    $usrArray = App\Recruitment::all()->lists('id')->toArray();
    return ['recruitment_id' => $faker->randomElement($rcArray), 'user_id' => $faker->randomElement($usrArray)];
});