app/Http/Controllers/recursoshumanos/rrhtipocontratocontroller.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([
            'descripcion'=>'required']);
        try {
                $rrhtipocontrato = Rrhtipocontrato::find($id);
                $rrhtipocontrato->descripcion=$request->descripcion;
                $rrhtipocontrato->save();
          return redirect()->route('rhtipocontratos.index');
        } catch (\Exception $exception) {
            return  redirect()->back()->with('error', "Error" . $exception->getMessage());
        }
    }
public function update ( Request $ request , $ id ) { $ request -> validate ( [ 'descripcion' => 'required' ] ) ; try { $ rrhtipocontrato = Rrhtipocontrato :: find ( $ id ) ; $ rrhtipocontrato -> descripcion = $ request -> descripcion ; $ rrhtipocontrato -> save ( ) ; return redirect ( ) -> route ( 'rhtipocontratos.index' ) ; } catch ( \ Exception $ exception ) { return redirect ( ) -> back ( ) -> with ( 'error' , " Error " . $ exception -> getMessage ( ) ) ; } }
Update the specified resource in storage.
Update the specified resource in storage .