PageSourceSearch

https://firestore-eloquent.netlify.app/assets/js/be14e717.57bdb2d3.js

js firestore-eloquent.netlify.app collected 2026-10-03 10:45:26 UTC 3,398 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkfirestore_eloquent=self.webpackChunkfirestore_eloquent||[]).push([[7801],{236:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>d,frontMatter:()=>o,metadata:()=>s,toc:()=>u});var i=t(5893),r=t(1151);const o={sidebar_position:7},a="Pagination",s={id:"guide/eloquent/pagination",title:"Pagination",description:"Pagination in Firestore Eloquent Library",source:"@site/docs/guide/eloquent/pagination.mdx",sourceDirName:"guide/eloquent",slug:"/guide/eloquent/pagination",permalink:"/docs/guide/eloquent/pagination",draft:!1,unlisted:!1,editUrl:"https://github.com/FreddyWhest/firestore-eloquent-docs/tree/main/docs/guide/eloquent/pagination.mdx",tags:[],version:"current",sidebarPosition:7,frontMatter:{sidebar_position:7},sidebar:"tutorialSidebar",previous:{title:"Relationships",permalink:"/docs/guide/eloquent/relationships"},next:{title:"Aggregations",permalink:"/docs/guide/eloquent/aggragations"}},l={},u=[{value:"Pagination in Firestore Eloquent Library",id:"pagination-in-firestore-eloquent-library",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"pagination",children:"Pagination"}),"\n",(0,i.jsx)(n.h2,{id:"pagination-in-firestore-eloquent-library",children:"Pagination in Firestore Eloquent Library"}),"\n",(0,i.jsxs)(n.p,{children:["If your Firestore collection contains a large number of documents, you may paginate your search results using the paginate method. This method will return an ",(0,i.jsx)(n.code,{children:"Illuminate\\Pagination\\LengthAwarePaginator"})," instance just as if you had ",(0,i.jsx)(n.a,{href:"https://laravel.com/docs/11.x/pagination",children:"paginated a traditional Eloquent query"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.code,{children:"paginate()"})})," method allows you to retrieve a specific number of documents per page, making it easier to navigate through large result sets."]}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.strong,{children:(0,i.jsx)(n.code,{children:"paginate()"})})," method accepts two arguments:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"The number of documents to retrieve per page"}),"\n",(0,i.jsx)(n.li,{children:"The current page number"}),"\n"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-php",children:"// Paginate all users with 10 users per page\r\n$currentPage = request()->get('page', 1);\r\n$users = User::paginate(10, $currentPage);\r\n\r\n// Get pagination links\r\n$users->links();\n"})}),"\n",(0,i.jsxs)(n.p,{children:["For more information about pagination, please refer to the ",(0,i.jsx)(n.a,{href:"/docs/guide/eloquent/pagination",children:"Pagination Documentation"}),"."]})]})}function d(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},1151:(e,n,t)=>{t.d(n,{Z:()=>s,a:()=>a});var i=t(7294);const r={},o=i.createContext(r);function a(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.