You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Require PHP 8.2+ (drop 8.1)
- Add PHP 8.4 to test matrix
- Update dev dependencies (PHPUnit 10.5+/11, Mockery 1.6+, Scout 10.8+/11)
- Upgrade MySQL to 8.4 in CI
- Update PHPUnit config to v11 schema format
- Replace @test annotations with #[Test] attributes
- Clean up FUNDING.yml
- Add CLAUDE.md
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+
## Project Overview
6
+
7
+
Fast Paginate is a Laravel package that provides an optimized `limit`/`offset` pagination method using a "deferred join" technique. Instead of fetching full rows during pagination, it first retrieves only primary keys in an optimized subquery, then fetches full records for those specific IDs. This significantly improves performance on large datasets.
3. Use the retrieved IDs in a `WHERE IN` clause on the original query
39
+
4. Return full records with proper pagination metadata
40
+
41
+
-**`BuilderMixin`** (`src/BuilderMixin.php`): Adds `fastPaginate()` and `simpleFastPaginate()` methods to Eloquent Builder
42
+
43
+
-**`RelationMixin`** (`src/RelationMixin.php`): Adds the same methods to Eloquent Relations, with special handling for `BelongsToMany` and `HasManyThrough`
44
+
45
+
-**`ScoutMixin`** (`src/ScoutMixin.php`): Provides `fastPaginate()` on Laravel Scout builders (defers to standard pagination as Scout already optimizes)
46
+
47
+
### Fallback Behavior
48
+
49
+
The package automatically falls back to standard pagination when:
50
+
- Query contains `havings`, `groups`, or `unions`
51
+
-`perPage` is set to `-1` (get all records)
52
+
- Query contains incompatible expressions (detected via `QueryIncompatibleWithFastPagination`)
53
+
54
+
### Key Implementation Detail
55
+
56
+
Order-by columns that reference computed/aliased columns are preserved in the inner query to maintain correct ordering during the key-selection phase.
0 commit comments