For example, there are a total of 10 pieces of data with IDs 1-10, and now I want to query the 5 pieces of data after the specified ID based on the passed ID,
For example, if the incoming id is 1, the data with id 1,2,3,4,5 will be queried.
If the id is 3, the id will be 3,4,5,6. 7 data
How to write?Thank you
大家讲道理2017-05-16 16:50:32
Take the users table as an example:
\DB::table('users')
-> where('id', '>=', $id)
-> orderBy('id')
-> take(5)
-> get();