Skip to content

Eloquent orderByRaw error with two withCount() value on PGSQL #45479

Answered by staudenmeir
denizgolbas asked this question in Q&A
Discussion options

You must be logged in to vote

@denizgolbas Laravel can't handle this kind of query for PostgreSQL users automatically.

But postgre syntax like this:

You need to build this query yourself with Eloquent (or the query builder) using fromSub().

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@denizgolbas
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by denizgolbas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants