/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $fixeds = FixedCost::lists('fixedcost', 'id'); $variables = VariableCost::lists('variablecost', 'id'); $result = Result::find($id); if ($result) { return view('result.edit', ['result' => $result, 'fixeds' => $fixeds, 'variables' => $variables]); } else { return redirect()->action('ResultController@index')->with('error', 'El resultado solicitado no existe'); } }