In this tutorial, we will see skip and take query example in laravel application. I will show you laravel eloquent skip() and take() query example.


Given below are two-two example for skip and take and limit and offset query in laravel. 



Example 1 : Skip and Take

/**
* The attributes that are mass assignable.
*
* @var array
*/
public function index()
{
    $users = User::skip(4)->take(6)->get();
}



Example 2 : Skip and Take

/**
* The attributes that are mass assignable.
*
* @var array
*/
public function index()
{
    $users = DB::table('users')->skip(4)->take(6)->get();
}



Example 1 : Offset and Limit

/**
* The attributes that are mass assignable.
*
* @var array
*/
public function index()
{
    $users = User::offset(4)->limit(6)->get();
}



Example 2 : Offset and Limit

/**
* The attributes that are mass assignable.
*
* @var array
*/
public function index()
{
    $users = DB::table('users')->offset(4)->limit(6)->get();
}



I hope this example helps you.