In this step, we need to run the migration command to create a users table and then create dummy users records so we can see pagination. This is because the "offset" clause scans through all previously matched data. Route::any ( '/search', function () { Using that package you can use the jsonPaginate method instead of paginate() on the QueryBuilder. Laravel 9 Flash Message Timeout and Hide Message Example.