/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $posts = Post::getMaisrelevantes()->keyBy('id');
     $posts_total = count($posts);
     $posts = $posts->slice(0, env('QUANTIDADE_FEED_POST'), true);
     return view('conectar.index', compact('posts'));
 }
Example #2
0
 public function getPosts($pagina)
 {
     $posts = Post::getMaisrelevantes()->keyBy('id');
     $posts_total = count($posts);
     $posts = $posts->slice($pagina * env('QUANTIDADE_FEED_POST'), env('QUANTIDADE_FEED_POST'), true);
     $pagina++;
     return view('feed', compact('posts', 'pagina'));
 }