public function index() { $victories = Victory::orderBy('created_at', 'DESC')->limit(4)->get(); $blogs = Blog::orderBy('created_at', 'DESC')->limit(4)->get(); $images = Post::where('is_carasaul', '=', 1)->get(); $testimonials = Testimonial::orderBy('created_at', 'DESC')->limit(1)->get(); return View::make('pages.index', compact('images', 'testimonials', 'victories', 'blogs')); }
public function index() { $user_id = Input::get('user_id'); if (FEUsersHelper::isCurrentUser($user_id)) { $blogs = Blog::orderBy('updated_at', 'DESC')->where('user_id', $user_id)->get(); } else { $blogs = Blog::orderBy('updated_at', 'DESC')->where('user_id', $user_id)->where('privacy', 1)->get(); } return View::make('frontend/blogs/index')->with('user', User::find($user_id))->with('blogs', $blogs); }
public function index_users() { $tags = Tag::all(); $blogs = Blog::orderBy('created_at', 'desc')->where('is_published', '=', 1)->paginate(10); return View::make('blogs.index_user', compact('blogs', 'tags')); }
public function mostrarBlog() { //$Posts = DB::table('blog')->orderBy('id','desc')->paginate(2); //$bannersizquierda = DB::table('banners')->where('seccion', '=', 'BLOG-IZQUIERDA','AND')->where('habilitar', '=', '1')->orderBy('id','asc')->get(); $bannersizquierda = Banner::where('seccion', '=', 'BLOG-IZQUIERDA')->where('habilitar', '=', '1')->orderBy('id', 'asc')->get(); $bannersderecha = Banner::where('seccion', '=', 'BLOG-DERECHA')->where('habilitar', '=', '1')->orderBy('id', 'asc')->get(); $bannersindexarriba = Banner::where('seccion', '=', 'INDEX-ARRIBA')->where('habilitar', '=', 1)->orderBy('id', 'asc')->get(); $blog = Blog::orderBy('fecha', 'desc')->paginate(5); $anuncios = Anuncio::all(); $rolusuarioLogueado = ''; $mailusuarioLogueado = ''; $nombreusuarioLogueado = ''; if (Auth::check()) { $authuser = Auth::user(); $usu = Usuario::find($authuser->id); $mailusuarioLogueado = $authuser->email; $nombreusuarioLogueado = $authuser->nombre; $rolusuarioLogueado = DB::table('usuario_tiene_rol2')->where('usuario_id', '=', $authuser->id)->first(); $rolusuarioLogueado = UsuarioRol::find($rolusuarioLogueado->rol_id)->rol; } return View::make('index.blog')->with(array('bannersizquierda' => $bannersizquierda, 'bannersderecha' => $bannersderecha, 'blog' => $blog, 'anuncios' => $anuncios, 'username' => $mailusuarioLogueado, 'nameuser' => $nombreusuarioLogueado, 'roluser' => $rolusuarioLogueado, 'bannersindexarriba' => $bannersindexarriba)); // }
public function articles() { $articles = Blog::orderBy('id', 'DESC')->paginate(4); return View::make('blog.articles', compact('articles')); }