1, 'ciclo'=> 1, 'nivel'=> 1, 'plantel'=> 3, 'turno'=> 1, 'status'=> 1 ]); $grupo->alumnos()->sync([1,2,3,4,5,6,7,8,9,10]); for ($i=1; $i <=10 ; $i++) { Alumno::where('id', $i)->update([ 'status' => 3 ]); } $grupo2 = Grupo::create([ 'plan_id'=> 2, 'ciclo'=> 1, 'nivel'=> 2, 'plantel'=> 3, 'turno'=> 2, 'status'=> 1 ]); $grupo2->alumnos()->sync([16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]); for ($i=16; $i <=30 ; $i++) { Alumno::where('id', $i)->update([ 'status' => 3 ]); } } }