Exemplo n.º 1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $gasto = TipoGastoModel::findOrFail($id);
     dd($gasto);
     //$gasto->delete();
     //Session::flash('message', $gasto->nombre.' fue eliminado');
     return redirect()->route('tipo_gasto');
 }
Exemplo n.º 2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $gasto = GastoModel::findOrFail($id);
     $datos = array();
     $datos['gasto_id'] = $gasto->id;
     $datos['id_tipo_gasto'] = $gasto->tipo_gasto->id;
     $datos['tipo_gasto_nombre'] = $gasto->tipo_gasto->nombre;
     $datos['importe'] = $gasto->importe;
     $datos['fecha_vencimineto'] = $gasto->fecha_vencimineto;
     $tipos_gasto = TipoGastoModel::all();
     $datos_tipo = array();
     foreach ($tipos_gasto as $tipo) {
         $datos_tipo[$tipo->id] = $tipo->nombre;
     }
     return view('gasto/editar', ['gasto' => $datos, 'title_panel' => 'Editar Gastos', 'tipo_gasto' => $datos_tipo]);
 }