dbstudios/doctrine-query-document
Build Doctrine DQL filters from a simple array “query document”. Apply conditions to an existing QueryBuilder (from/select required), auto-bind positional parameters, traverse relations via dot notation, and query JSON fields (MySQL 5.7+).
HINT, WITH clauses) unsupported by the document syntax.For Executives: "This package lets our devs write MongoDB-style queries for SQL databases—cutting query development time by 30% while keeping our existing Doctrine infrastructure. It’s a low-risk way to adopt flexible querying for hybrid data projects or internal tools, with no vendor lock-in. Think of it as ‘SQL with a MongoDB keyboard’—familiar for teams coming from NoSQL, but still leveraging our proven Doctrine stack."
For Engineering: "This solves the pain of translating MongoDB query docs to DQL manually. For example, instead of writing:
$qb->where('e.relatedEntity.field > :val')->setParameter('val', 10);
You just pass:
['relatedEntity.field' => ['$gt' => 10]]
It handles parameter binding automatically and supports dot notation for relationships. Best for ad-hoc queries, prototyping, or teams mixing SQL/NoSQL. Tradeoff: Slight abstraction overhead (~5–10% query complexity), but massive productivity gains for complex filters. Benchmark critical paths first."
For Developers:
"If you’ve ever cursed DQL’s verbosity or missed MongoDB’s query docs, this is your cheat code. Works with any Doctrine entity, supports $gt, $lt, $in, etc., and even traverses relationships like user.address.city. Just install it, wrap your QueryBuilder, and query like it’s MongoDB—while still getting SQL under the hood."
How can I help you explore Laravel packages today?