app/Http/Controllers/ClienteController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\Cliente  $cliente
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request)
    {
        $editCliente = Cliente::findOrFail($request->cliente);
        $editCliente->abonado=$request->input('nombre');
        $editCliente->propiedad=$request->input('propiedad');
        $editCliente->sector=$request->input('sector');
        $editCliente->servicio=$request->input('servicio');
        $aux = $request->input('servicio');
        if($aux == 1){
            $editCliente->pago_mes = 50;
        }
        elseif($aux == 2){
            $editCliente->pago_mes = 70;
        }
        elseif($aux == 3){
            $editCliente->pago_mes = 90;
        }
        $editCliente->save();
        return redirect('/home');
    }
public function update ( Request $ request ) { $ editCliente = Cliente :: findOrFail ( $ request -> cliente ) ; $ editCliente -> abonado = $ request -> input ( 'nombre' ) ; $ editCliente -> propiedad = $ request -> input ( 'propiedad' ) ; $ editCliente -> sector = $ request -> input ( 'sector' ) ; $ editCliente -> servicio = $ request -> input ( 'servicio' ) ; $ aux = $ request -> input ( 'servicio' ) ; if ( $ aux == 1 ) { $ editCliente -> pago_mes = 50 ; } elseif ( $ aux == 2 ) { $ editCliente -> pago_mes = 70 ; } elseif ( $ aux == 3 ) { $ editCliente -> pago_mes = 90 ; } $ editCliente -> save ( ) ; return redirect ( '/home' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
//dd($request); //dd($aux);