app/Http/Controllers/EmpleadoController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        $request->validate([
            'cedula' => 'required',
            'nombres' => 'required',
            'apellidos' => 'required',
            'sexo' => 'required',
            'telefono' => 'required',
            'correo' => 'required',
            'cargo_id' => 'required',
        ]);
        $update = [ 'cedula' => $request->cedula,
                    'nombres' => $request->nombres,
                    'apellidos' => $request->apellidos,
                    'sexo' => $request->sexo,
                    'telefono' => $request->telefono,
                    'correo' => $request->correo,
                    'cargo_id' => $request->cargo_id,
                ];
        Empleado::where('id',$id)->update($update);
        return redirect()->route('empleado.index')->with('datos','Registro Editado Correctamente!');
    }
public function update ( Request $ request , $ id ) { $ request -> validate ( [ 'cedula' => 'required' , 'nombres' => 'required' , 'apellidos' => 'required' , 'sexo' => 'required' , 'telefono' => 'required' , 'correo' => 'required' , 'cargo_id' => 'required' , ] ) ; $ update = [ 'cedula' => $ request -> cedula , 'nombres' => $ request -> nombres , 'apellidos' => $ request -> apellidos , 'sexo' => $ request -> sexo , 'telefono' => $ request -> telefono , 'correo' => $ request -> correo , 'cargo_id' => $ request -> cargo_id , ] ; Empleado :: where ( 'id' , $ id ) -> update ( $ update ) ; return redirect ( ) -> route ( 'empleado.index' ) -> with ( 'datos' , 'Registro Editado Correctamente!' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
//  return Redirect::to('empleado') // ->with('success','Empleado Actualizado Satisfactoriamente');