derafu/query
Expressive path-based query builder for PHP from Derafu. Build queries using readable, JSONPath-like paths for nested data structures and collections. Lightweight package with full documentation at derafu.dev/docs/data/query.
users.where('address.city', 'eq', 'Berlin')) for admin panels or public APIs.posts.with('author.profile')).status = shipped AND customer.tier = premium").articles.with('author.bio', 'tags.name')).query->where('user.profile.bio', 'contains', 'PHP')), bridging the gap between ORM and raw SQL while maintaining security (SQL injection protection).user.address.city or posts.comments[*].author)."This package lets us build flexible, secure data queries without writing raw SQL or overhauling our API. For example, instead of hardcoding filters like WHERE status = 'active' AND user_id IN (...), we can dynamically traverse nested data (e.g., user.address.city) with a clean, declarative syntax. This reduces backend development time by 30–50% for complex filtering—critical for our [Admin Panel/Roadmap Feature]. The MIT license and Laravel integration make it low-risk, and we can start with a pilot in [Module X]. It’s a lightweight alternative to GraphQL for teams that need expressiveness without the overhead."
*"Derafu/Query offers a path-based query builder for PHP/Laravel that combines the best of Eloquent and GraphQL. Key benefits:
posts.where('author.name', 'eq', 'John') instead of chaining ->whereHas()->orWhere().Tradeoffs:
query->where('path.to.field', 'operator', 'value')).Proposal: Use it for [Feature Y] where dynamic filtering is painful. If successful, we can expand it to replace ad-hoc SQL in [Module Z]. Start with a pilot in non-critical endpoints to validate performance and syntax ergonomics."*
*"This package enables more intuitive data filtering in our admin tools and APIs. For example:
customer.tier or shipping.address.city without writing SQL.articles?author.bio=contains:PHP) without backend changes.It’s like GraphQL for Laravel but simpler—no schema files or resolvers, just direct path queries."*
How can I help you explore Laravel packages today?