Weave 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

Perpage Trait Laravel Package

quantumtecnology/perpage-trait

A lightweight Laravel trait that adds flexible per-page pagination to your models and queries. Read and validate the per_page request parameter, apply sensible defaults and maximum limits, and keep list endpoints consistent with minimal code.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. A Laravel trait for per-page pagination is idiomatic at the controller/request layer, but HTTP pagination concerns do not belong in domain models. If the trait mutates Eloquent query state or overrides model $perPage globally, it couples transport concerns to persistence and becomes risky in modular, multi-tenant, or API-versioned architectures. It fits a conventional Laravel monolith or simple API superficially; it is not an architectural building block.

Integration feasibility. Integration is likely trivial: Composer install, use the trait, and pass per_page from the request. The real feasibility question is governance, not effort. With 1 star, 0 dependents, and no visible ecosystem validation, there is no evidence of production use, compatibility testing, or release discipline. A TPM should treat this as a code sample, not a dependency.

Technical risk. Code-surface risk is low because the package is probably small. Dependency risk is high: likely single-maintainer abandonment, no security response process, unclear Laravel/PHP version constraints, possible method collisions in traits, and an uncapped per_page query parameter that can become a database/memory abuse vector. The misspelled vendor namespace (quantumtecnology) is a minor but real integration smell. MIT licensing permits forking or copying, which reduces lock-in but also undermines the case for adding the dependency.

Key questions. Does it validate per_page as an integer, apply a default, and enforce a server-side maximum? Which Laravel and PHP versions are supported? Is there a test suite and CI? Does it work with length-aware pagination, cursor pagination, and API resources? Is it applied to models or controllers? Does it override existing $perPage behavior globally? How are zero, negative, and oversized values handled? Who maintains it, and what is the release history? Does it respect tenant or role-based limits?

Integration Approach

Stack fit. Fits Laravel applications that already expose query-param pagination. It does not fit non-Laravel services, strict layered architectures, or teams standardizing pagination policy across multiple frameworks. If used, isolate it behind an internal base controller, request object, or PaginationPolicy so call sites do not depend directly on the vendor trait.

Migration path. Treat the package as a reference implementation rather than a platform dependency. Spike it in one read-only endpoint, add contract tests for default, max, invalid, zero, and negative values, then compare behavior with existing pagination. If the behavior is acceptable, vendor the trait into app/Support with MIT attribution and pin the source. Migration away is cheap because the code surface and call sites should be small.

Compatibility. Verify Composer constraints against the current Laravel/PHP matrix. Check for trait method collisions such as getPerPage, perPage, or scopePerPage. Confirm it does not globally change model pagination defaults. Validate pagination metadata against existing API contracts, because clients often depend on current_page, last_page, per_page, and total.

Sequencing. First inspect the source and confirm behavior. Second, security-test per_page abuse. Third, implement an internal wrapper with explicit default and hard maximum. Fourth, pilot one endpoint behind a feature flag. Fifth, add regression tests and document the policy. Sixth, decide whether to keep, fork, or replace. Do not make this package a blocker for feature delivery.

Operational Impact

Maintenance. Maintenance ownership effectively transfers to the adopting team. With 1 star and 0 dependents, there is no meaningful community to absorb fixes, Laravel upgrades, or security issues. MIT allows a fork, but a fork still requires internal ownership. An internal copy is preferable to an unpinned third-party dependency for something this small.

Support. There is no vendor support and likely limited issue responsiveness. Internal documentation must define the default page size, maximum page size, accepted parameter name, and error behavior. Support cost is low in code terms but higher in ambiguity: on-call engineers will need to know whether a large per_page value is a client bug, an abuse attempt, or expected behavior.

Scaling. The main scaling risk is unbounded per_page, which can cause large database reads, high memory use, expensive serialization, and API latency spikes. Enforce a hard maximum at the edge, for example 100, with a conservative default such as 15 or 25. The trait does not solve rate limiting, deep offset pagination, or large export workloads; those need separate controls and possibly cursor pagination.

Failure modes. Invalid values may throw exceptions or silently fall back; zero or negative values may produce empty or malformed responses; oversized values can exhaust memory or saturate the database; trait method collisions can cause fatal errors; Laravel upgrades may break signature assumptions; global overrides may unexpectedly change unrelated endpoints; inconsistent pagination metadata can break client integrations.

Ramp-up. A Laravel developer can understand the package in minutes and validate it in hours. Organizational ramp-up is mostly policy and documentation: where pagination is configured, what limits apply, and how new endpoints adopt the standard. Given the tiny scope, the decision cost dominates the implementation cost. Recommendation: do not adopt as a strategic dependency; copy the pattern or implement a small internal trait with explicit validation, defaults, and caps.

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.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel