Пример #1
0
 /**
  * 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');
     }
 }
Пример #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     //ELIMINA GASTO VARIABLE
     $variable = VariableCost::find($id);
     if ($variable->delete()) {
         //SE REGISTRA EL GASTO VARIABLE EN LA BITACORA
         $this->binnacle("ElIMINÓ GASTO VARIABLE");
     }
     Session::flash('message', 'El Gasto Variable se eliminó correctamente');
     return Redirect::to('/variablecost');
 }