Level 75
I think this could work
->orderByRaw('status = "pending" desc')->orderBy('created_at')
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello Genius,
I can get the list with order by date or anything with asc or desc. But I need to fetch the data which 'status' = 'pending' first then others status.
How can I do that?
TIA
I think this could work
->orderByRaw('status = "pending" desc')->orderBy('created_at')
Please or to participate in this conversation.