Laravel : Eloquent Skip records

后端 未结 1 601
说谎
说谎 2021-01-25 02:25

How did i get my users but start only at a certain position ? I get the 50 first with :

$users = User::orderBy(\'xp\', \'DESC\')->take(50)->get();
<         


        
相关标签:
1条回答
  • 2021-01-25 02:56

    You can use skip()

    Laravel eloqunt provides nice way to achieve this.

    $users = User::orderBy('xp', 'DESC')->skip(50)->take(50)->get();
    

    Hope this helps.

    0 讨论(0)
提交回复
热议问题