/** * Run the database seeds. * * @return void */ public function run() { $faker = Faker::create(); $Postulante = Postulante::all(); $samples_temp = []; foreach ($Postulante as $item) { $samples_temp[] = ['postulante' => $item->id, 'cuerpo' => $faker->text($maxNbChars = 200), 'validado' => $faker->numberBetween($min = 0, $max = 1)]; } Testimonio::insert($samples_temp); }
/** * Run the database seeds. * * @return void */ public function run() { $faker = Faker::create(); $tipoPasaporte = array('p', 'ci'); $postulante = Postulante::all(); $samples_temp = []; foreach ($postulante as $item) { $samples_temp[] = ['tipo' => $tipoPasaporte[$faker->numberBetween($min = 0, $max = 1)], 'numero' => $faker->creditCardNumber, 'postulante' => $item->id]; } DocumentoIdentidad::insert($samples_temp); }
public function getPostByGeo() { $algo = new DataGraphic(); $arrayFinal = array('name' => 'Postulantes', 'size' => Postulante::all()->count(), 'children' => $algo->recursiva('continente', '1', 'asdf', 'm')); $json_pbg = json_encode($arrayFinal); $fp = fopen("json_postbygeo.json", "w"); fputs($fp, $json_pbg); fclose($fp); $cant = Postulante::all()->count(); return view('estadisticas.postulante_ubicacion', compact('cant')); }
public function getListaPostulantes($id) { $postulaciones = Postulacion::where('cargo_id', $id)->get(); $postulaCargos = Postulante::all(); $cargo = Cargo::find($id); $postulantes = []; foreach ($postulaciones as $postulacion) { foreach ($postulaCargos as $postulaCargo) { if ($postulacion->postulante_id == $postulaCargo->id) { $postulantes[] = $postulaCargo; } } } return view('personal.seleccion.listaPostulantes')->with(compact(['cargo', 'postulantes'])); }