public function agregar() { //Aca se manda a la funcion agregarItem de la clase Item //y se queda con la respuesta para redirigir cual sea el caso $respuesta = PortfolioCompleto::agregar(Input::all()); /* if ($respuesta['error'] == true) { return Redirect::to('admin/producto')->withErrors($respuesta['mensaje'])->withInput(); } else { return Redirect::to('admin/producto')->with('mensaje', $respuesta['mensaje']); } * */ if ($respuesta['error'] == true) { $seccion = Seccion::find(Input::get('seccion_id')); $menu = $seccion->menuSeccion()->lang()->url; $ancla = '#' . $seccion->estado . $seccion->id; return Redirect::to($this->array_view['prefijo'] . '/admin/' . $this->folder_name . '/agregar/' . $seccion->id)->with('mensaje', $respuesta['mensaje'])->with('error', true); //->with('ancla', $ancla); //return Redirect::to('admin/producto')->withErrors($respuesta['mensaje'])->withInput(); } else { $seccion = Seccion::find(Input::get('seccion_id')); $menu = $seccion->menuSeccion()->lang()->url; $ancla = '#' . $seccion->estado . $seccion->id; return Redirect::to($this->array_view['prefijo'] . '/' . $menu)->with('mensaje', $respuesta['mensaje'])->with('ancla', $ancla)->with('ok', true); } }