public function portfolio_completo() { return PortfolioCompleto::where('portfolio_simple_id', $this->id)->first(); }
public function destacar() { //Aca se manda a la funcion editarItem de la clase Item //y se queda con la respuesta para redirigir cual sea el caso $respuesta = PortfolioCompleto::destacar(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) { return Redirect::to('admin/' . $this->folder_name)->withErrors($respuesta['mensaje'])->withInput(); } else { if (Input::get('continue') == "home") { return Redirect::to('/')->with('mensaje', $respuesta['mensaje']); } else { $menu = $respuesta['data']->portfolio_simple()->item()->seccionItem()->menuSeccion()->url; $ancla = '#' . $respuesta['data']->portfolio_simple()->item()->seccionItem()->estado . $respuesta['data']->portfolio_simple()->item()->seccionItem()->id; return Redirect::to('/' . $menu)->with('mensaje', $respuesta['mensaje'])->with('ancla', $ancla); } } }
public function lang() { $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first(); $portfolio_completo = PortfolioCompleto::join('portfolio_completo_lang', 'portfolio_completo_lang.portfolio_completo_id', '=', 'portfolio_completo.id')->where('portfolio_completo_lang.lang_id', $lang->id)->where('portfolio_completo.id', $this->id)->first(); if (is_null($portfolio_completo)) { echo "Por null"; $lang = Idioma::where('codigo', 'es')->where('estado', 'A')->first(); $portfolio_completo = PortfolioCompleto::join('portfolio_completo_lang', 'portfolio_completo_lang.portfolio_completo_id', '=', 'portfolio_completo.id')->where('portfolio_completo_lang.lang_id', $lang->id)->where('portfolio_completo.id', $this->id)->first(); } return $portfolio_completo; }