Exemplo n.º 1
0
 public static function editar($input)
 {
     $respuesta = array();
     $reglas = array();
     $validator = Validator::make($input, $reglas);
     if ($validator->fails()) {
         $respuesta['mensaje'] = $validator;
         $respuesta['error'] = true;
     } else {
         $html = TextoHtml::find($input['html_id']);
         //            $html->cuerpo = $input['cuerpo'];
         //
         //            $html->save();
         $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
         $html_lang = TextoHtml::join('html_lang', 'html_lang.html_id', '=', 'html.id')->where('html_lang.lang_id', $lang->id)->where('html.id', $html->id)->first();
         $datos = array('cuerpo' => $input['cuerpo']);
         $html_modificacion = DB::table('html_lang')->where('id', $html_lang->id)->update($datos);
         $input['descripcion'] = NULL;
         $item = Item::editarItem($input);
         $respuesta['mensaje'] = 'HTML modificado!';
         $respuesta['error'] = false;
         $respuesta['data'] = $html;
     }
     return $respuesta;
 }