Skip to content

This library provides an easy way to paginate with AdonisJS

License

Notifications You must be signed in to change notification settings

phabloraylan/adonis-paginate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adonis-paginate

A provider for the Adonis framework.

This library provides an easy way to paginate with AdonisJS.

Install

npm install --save adonis-paginate

Configure

Register the provider in start/app.js:

const providers = [
  ...
  'adonis-paginate/providers/PaginateProvider'
]

Example

Route.get('/customers', ({ request }) => {
  const { page, limit, sort, desc } = request.paginate()

  console.log(`page: ${page}`) // default: 1
  console.log(`limit: ${limit}`) // default: 50, max: 100
  console.log(`sort: ${sort}`) // default: created_at
  console.log(`desc: ${desc}`) // default: true, return: desc or asc
})

Thanks

Special thanks to the creator(s) of AdonisJS for creating such a great framework.

About

This library provides an easy way to paginate with AdonisJS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published