-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Query\Builder only produces an aggregation when groupBy or an aggregate function is set. The Filament hooks need to add $lookup, $addFields and $match stages, plus a sort on a computed field, to an otherwise ordinary Eloquent query that Filament later paginates.
Add to Query\Builder:
- storage for extra pipeline stages, a computed-field sort, and temporary fields to $unset
- in toMql(), when stages are present, fold the find command into aggregate ($match wheres, stages, $sort with computed sorts first, $skip/$limit, projection, $unset)
- the same for countDocuments (ending in $count) so paginate() totals include a $match added by a hook
- insert the stages after the leading $match of an existing aggregate command
No public API change for users; only the hooks call this.
Filament features this enables: relationship column sorting, aggregate column sorting, aggregate filtering and table pagination on the resulting queries. Reference implementation: the demo's ZooMongoQueryBuilder (Pauline has the demo).
- is depended on by
-
PHPLARA-284 Filament support: add Eloquent\Builder::orderByRelationAggregate()
-
- Blocked
-
-
PHPLARA-285 Filament support: add Eloquent\Builder::whereRelationAggregate()
-
- Blocked
-
- related to
-
PHPLARA-292 SPIKE: Investigate Filament support
-
- Closed
-