Пример #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy()
 {
     $parametros = Input::get();
     $reglas = array('id' => 'required|integer');
     $validator = Validator::make($parametros, $reglas);
     if (!$validator->fails()) {
         Ingresos::destroy($parametros['id']);
         $res['data'] = Ingresos::All();
         $respuesta = json_encode(array('error' => false, 'mensaje' => '', 'respuesta' => $res));
     } else {
         $respuesta = json_encode(array('error' => true, 'mensaje' => 'No hay parametros o estan mal.', 'respuesta' => null));
     }
     $final_response = Response::make($respuesta, 200);
     $final_response->header('Content-Type', "application/json; charset=utf-8");
     return $final_response;
 }