ideas icon indicating copy to clipboard operation
ideas copied to clipboard

Implementation of OrderByRaw method on Content Queries

Open mbs-arran-baker opened this issue 8 months ago • 0 comments

It would be useful to have an implementation of the Laravel Query Builder 'orderByRaw' method on Statamic Content Queries. The current ordering methods are limited when trying to apply a custom order to query results.

For example being able to apply a defined order based on the returned results id:

$query->orderByRaw("FIELD(id, [2, 4, 7, 3, 9])")

mbs-arran-baker avatar May 08 '25 11:05 mbs-arran-baker