Loading…

How to use skip() and take() in Laravel Query?

We can use skip() and take() both methods to limit the number of results in the query. skip() is used to skip the number of results and take() is used to get the number of result from the query.

Example

                                        

$posts = DB::table('blog')->skip(5)->take(10)->get();

// skip first 5 records
// get 10 records after 5

Suggest An Answer

No suggestions avaliable!

Latest post from Laravel Interview Questions

Ask Question