datajoe/postgresql-distinct-on
Adds PostgreSQL DISTINCT ON support to Laravel's query builder and Eloquent, so you can fetch the first row per group with a clean, chainable API. Ideal for latest-per-user or per-category queries without raw SQL or subqueries.
datajoe/postgresql-distinct-on adds first-class support for PostgreSQL's DISTINCT ON clause to Laravel's Eloquent and query builder. It lets you fetch the first row per group—such as the latest order per customer—without raw SQL, subqueries, or window functions.
distinctOn() method on query and Eloquent buildersORDER BY handlingwhere, joins, scopes, and relationshipsGROUP BY workaroundsHow can I help you explore Laravel packages today?