/** * Run the migrations. * * @return void */ public function up() { Schema::table('correlations', function (Blueprint $table) { // }); $batches = [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009]; $allStudents = []; $programs = Program::select('programid')->get(); foreach ($programs as $program) { $programid = $program->programid; foreach ($batches as $batch) { $allStudents[$batch] = Studentterm::getBatchStudentsProgram($batch * 100000, $programid); } $this->alterOverload($batches, $allStudents, $programid); $this->alterUnits($batches, $allStudents, $programid); } }