aelfannir/doctrine-api-paginator
Symfony bundle for paginating Doctrine ORM queries with API-friendly filters. Supports property and nested compound filters (AND/OR) and operator-based comparisons to build query conditions cleanly for result lists.
doctrine-api-paginator) is designed to simplify pagination for Doctrine queries in API responses, aligning well with Laravel’s Eloquent/Doctrine ORM use cases (if Doctrine is integrated). For pure Laravel (Eloquent), this may introduce unnecessary complexity unless Doctrine is already in the stack.{"property": "name", "operator": "LIKE"}).fractal/manager, spatie/laravel-query-builder) are more idiomatic.DQL). Eloquent queries would need translation, adding overhead.AND/OR operations could generate inefficient SQL if not optimized (e.g., lack of query caching or index hints).operator values like "LIKE" are undefined). Custom validation would be required.spatie/laravel-query-builder don’t?operator values (e.g., "LIKE", "GT") documented or custom? How will they map to Laravel’s query builder?simple-pagination) or only offset/limit?fractal/manager or spatie/laravel-query-builder been evaluated for similar needs?spatie/laravel-query-builder are more aligned.Validator).use AElfannir\DoctrineQueryPaginator\Filter\Filter;
$filter = new Filter([
'property' => 'name',
'operator' => 'LIKE',
'value' => '%search%'
]);
public function handle(Request $request, Closure $next) {
$paginator = new DoctrineQueryPaginator($request->get('filters'));
// Inject into repository/service.
}
QueryBuilder to test filter logic.EXPLAIN queries).Cache::remember) would need integration for filtered query results./api/users).operator values).Log::debug('Applied filter:', ['filter' => $filter->toArray(), 'query' => $query->getSQL()]);
| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Malformed filter input | 500 errors or incorrect results | Validate input with Laravel’s Validator. |
| Doctrine query timeout | API timeouts | Increase query_builder.timeout in Doctrine config. |
| Missing database indexes | Slow queries | Add indexes for filtered properties. |
| Package incompatibility | Integration breaks | Fork and maintain locally. |
| Symfony version mismatch | Bundle fails to load | Use symfony/flex compatibility layer. |
How can I help you explore Laravel packages today?