overblog/dataloader-php
DataLoader is a PHP port of Facebook's DataLoader, providing batching and caching for data fetching. It solves the N+1 query problem by coalescing requests within a single tick, making it ideal for GraphQL resolvers with webonyx/graphql-php and any async or promise-based data layer.
overblog/dataloader-php is a framework-agnostic batching and caching utility, not a Laravel-specific ORM or HTTP abstraction. It fits best as a request-scoped read aggregation layer above repositories, Eloquent queries, or remote API clients. The strongest Laravel use case is GraphQL resolver fan-out, especially with Lighthouse/webonyx, or API composition endpoints where one request makes many independent lookups. It is a poor default for simple CRUD applications where Laravel eager loading, with(), chunking, and query caching already solve the problem with less complexity.Http client calls behind loader callables, and keep Laravel’s cache for cross-request persistence. In GraphQL, integrate at the resolver or data-source boundary; in REST, use it only where a single endpoint aggregates many independent lookups.How can I help you explore Laravel packages today?