Level 23
you can have two order by clauses in your query? whats ur current q looking like?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have two columns created_at and priority I want to show recently added records first. like I have 5 records on 27-Jan-2019. I want to show these 5 records using order by priority in asc.
Chain on the additional order. You need the date first and then the priority.
Model::latest()->orderBy('priority','DESC')->get();
Please or to participate in this conversation.