sergionc
6 months ago
508
1
Laravel

Update with eloquent

Posted 6 months ago by sergionc

I am trying to edit my form but it does not throw me any error, it just reloads the view

public function update(PagoUpdateRequest $request, $id) { Pago::findOrFail($id)->update($request->all()); Alert::success('Pago Editado', ''); return redirect('pago'); }

class Pago extends Model { protected $fillable = [

    'junta_id',
    'socio_id',
    'ncuota',
    'montototal',
    'montopagar',
    'montorestante',
    'multa',
    'observacion'

];

public function junta(){

    return $this->belongsTo(Junta::class);

}

public function socio(){

    return $this->belongsTo(Socio::class);

}

}

Please sign in or create an account to participate in this conversation.