app/Http/Controllers/soporte/soporteController.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)
    {
        try {
            $novedad=Novedad::find($id);
            $cliente=Cliente::find($novedad->cliente->id);
            $novedad->eliminar=0;
            $novedad->save();
            if($cliente->servicio==1){
                 $Soporteradio=Soporteradio::Create($request->all());
            }elseif($cliente->servicio==0){
                $Soportefibra=Soportefibra::Create($request->all());
            }
            return redirect()->route('soportes.index');
         }catch(\Exception $exception){
             return  redirect()->back()->with('error',"Error".$exception->getMessage());
         }
    }
public function update ( Request $ request , $ id ) { try { $ novedad = Novedad :: find ( $ id ) ; $ cliente = Cliente :: find ( $ novedad -> cliente -> id ) ; $ novedad -> eliminar = 0 ; $ novedad -> save ( ) ; if ( $ cliente -> servicio == 1 ) { $ Soporteradio = Soporteradio :: Create ( $ request -> all ( ) ) ; } elseif ( $ cliente -> servicio == 0 ) { $ Soportefibra = Soportefibra :: Create ( $ request -> all ( ) ) ; } return redirect ( ) -> route ( 'soportes.index' ) ; } catch ( \ Exception $ exception ) { return redirect ( ) -> back ( ) -> with ( 'error' , " Error " . $ exception -> getMessage ( ) ) ; } }
Update the specified resource in storage.
Update the specified resource in storage .