Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Pagination Laravel Package

spiral/pagination

Spiral Pagination Toolkit provides lightweight, framework-agnostic pagination primitives for PHP apps. Build and pass around page limits/offsets and related metadata cleanly, with strong type safety, tests, and Psalm support.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Standardizing API Responses: Enforce consistent pagination formats (e.g., data, meta.pagination) across REST/GraphQL APIs, reducing frontend integration friction.
  • Decoupling Pagination Logic: Separate pagination concerns from database queries, enabling reuse in non-DB contexts (e.g., file processing, external API responses).
  • API-First Roadmap: Align with GraphQL’s pagination standards (e.g., edges, pageInfo) or cursor-based APIs for scalable client-side rendering.
  • Build vs. Buy:
    • Buy for teams needing lightweight, interface-driven pagination without Laravel’s Eloquent overhead.
    • Build only if requiring tightly coupled database features (e.g., PostgreSQL window functions) or active maintenance.
  • Use Cases:
    • Admin Dashboards: Dynamic table pagination with shared interfaces for frontend/backend.
    • Public APIs: Cursor-based or offset-based pagination for mobile/web clients.
    • Microservices: Standardized pagination for internal service communication (e.g., event streams).

When to Consider This Package

  • Adopt if:

    • Your Laravel app uses multiple pagination styles (offset, cursor, keyset) and needs a unified interface to switch between them.
    • You’re building APIs or GraphQL services where pagination must be decoupled from databases (e.g., paginating third-party API responses).
    • Your team prioritizes type safety and interfaces over implementations (e.g., for testing or plugin architectures).
    • You need lightweight pagination without Laravel’s Eloquent dependencies or want to avoid Illuminate\Pagination bloat.
  • Look elsewhere if:

    • You’re heavily invested in Laravel’s Eloquent pagination and need its built-in features (e.g., lengthAwarePaginator, query builder integration).
    • Your use case requires advanced database-specific pagination (e.g., window functions, complex joins).
    • The package’s last release (2019) is a dealbreaker—consider alternatives like:
    • You need active maintenance or community support (this package has 4 stars, 0 dependents, and no recent updates).

How to Pitch It (Stakeholders)

For Executives: "This package standardizes pagination across our Laravel apps—reducing inconsistency in APIs, admin tools, and microservices. By decoupling pagination from databases, we can reuse logic for non-DB data (e.g., APIs, files) and improve API client experiences. It’s a lightweight, MIT-licensed solution that aligns with our API-first roadmap and cuts dev time for pagination-heavy features. Trade-off: Last updated in 2019, so we’d need to validate PHP 8.1+ compatibility."

For Engineering: "The spiral/pagination package provides PSR-compliant interfaces for offset/cursor/key-based pagination, letting us standardize responses across APIs, admin panels, and services. It’s ideal if we want to avoid Laravel’s Eloquent pagination or need pagination for non-database data. Trade-offs:

  • Pros: Lightweight, type-safe, framework-agnostic.
  • Cons: No Laravel integration (must build adapters), last release in 2019. Recommendation: Use for APIs or internal services where consistency matters. For web apps, pair with Laravel’s native pagination or spatie/laravel-pagination."*

For Developers: "This gives us pagination interfaces (PageInterface, PaginatorInterface) to enforce consistency. Example: Implement PageInterface for a custom ApiPaginator to standardize API responses. Trade-off: No built-in Laravel support—you’ll need to write adapters (e.g., for LengthAwarePaginator). Start with a pilot in a non-critical API endpoint."

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui