Guest User

Untitled

a guest
May 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. DB::statement(DB::raw('SET @rownum = 0'));
  2.  
  3. $tops = DB::table('articles')
  4. ->select(DB::raw('id','head','description', '@rownum := @rownum + 1 as rownum'))
  5. ->where('approve', '=', 'Aprobado')
  6. ->where('important','Destacado')
  7. ->orderBy('id', 'DESC')
  8. ->paginate(5);
  9.  
  10. <div id="tops0" class="card" style="border:none !important; margin: 0;">
  11. <a href="{{ route('show',$top->id.$top->head) }}">
  12. <img class="card-img-top" src="../images/{{$top->path}}" alt="Card image cap" style="height: 112px">
  13. </a>
  14. <a href="{{ route('show',$top->id.$top->head) }}" class="a-corregido2">
  15. <span id="">{{$top->rownum}}</span><span class="title-tops">{{ $top ->head }}</span>
  16. </a>
  17. </div>
  18.  
  19.  
  20. @endforeach
Add Comment
Please, Sign In to add comment