/** * Show the form for editing the specified employees. * * @ param int $id * * @return Response */ public function edit($id) { $employees = $this->employeesRepository->find($id); $TipoDoc = \App\Models\comboType::find(1)->Options->lists('description', 'id'); $Sexo = \App\Models\comboType::find(3)->Options->lists('description', 'id'); $EstadoCivil = \App\Models\comboType::find(4)->Options->lists('description', 'id'); $TipoContrato = \App\Models\comboType::find(5)->Options->lists('description', 'id'); $Ubicacion = \App\Models\comboType::find(6)->Options->lists('description', 'id'); $Localidades = \App\Models\comboType::join('comboOptions', 'comboTypes.id', '=', 'comboOptions.type_id')->where('comboTypes.type', 'Localidades')->lists('comboOptions.description', 'comboOptions.id')->prepend('', ''); $turno = \App\Models\comboType::join('comboOptions', 'comboTypes.id', '=', 'comboOptions.type_id')->where('comboTypes.type', 'Turno')->lists('comboOptions.description', 'comboOptions.id')->prepend('', ''); $ObraSocial = \App\Models\obraSocial::selectRaw('CONCAT(codigo, "-", nombre) as nombre, id')->lists('nombre', 'id')->prepend('', ''); $Category = \App\Models\Category::lists('category', 'id')->prepend('', ''); $Specialty = \App\Models\Specialty::where('category', '=', $employees->categoria)->get()->lists('specialty', 'id')->prepend('', ''); $conceptos_revista = \App\Models\concepto_revista::where('id', '!=', $employees->estado)->lists('descripcion', 'id')->prepend('', ''); $estado_revista = \App\Models\concepto_revista::find($employees->estado); $situacion_revista = \App\Models\EstadosRevista::with('Situacion')->DelLegajoVigente($id)->first(); $conyugue = \App\Models\Familiar::ConyugueDe($id)->first(); $hijos = \App\Models\Familiar::HijosDe($id)->get(); //$estados_revista = \App\Models\estado_revista::lists('descripcion','id'); //$categoria = \App\Models\Categorias::lists('categoria','id'); //$especialidad = \App\Models\Especialidades::lists('especialidad','id'); if (empty($employees)) { Flash::error('employees not found'); return redirect(route('employees.index')); } return view('employees.edit', compact('employees', 'TipoDoc', 'turno', 'Sexo', 'EstadoCivil', 'Ubicacion', 'TipoContrato', 'ObraSocial', 'Category', 'Specialty', 'conceptos_revista', 'estado_revista', 'situacion_revista', 'conyugue', 'hijos', 'Localidades')); //->with('estados_revista', $estados_revista) //->with('categoria', $categoria) //->with('especialidad', $especialidad) }