In this tutorial, we will see Offset and Limit query in laravel application. We will learn laravel limit query builder.


Given below are two examples to understand offset and Limit query in laravel application



Example 1

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



Example 2

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


I hope this example helps you.