Level 102
Laravel 4? Thats quite old :)
Dont know if this syntax was valid back then, but give it a shot
MyModel::orderByDesc('coloumn1')->orderBy('coloumn2')->get();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I want to sort multiple columns in Laravel 4 by using the method orderBy() in Laravel Eloquent. The query will be generated using Eloquent like this:
SELECT * FROM mytable ORDER BY coloumn1 DESC, coloumn2 ASC How can I do this?
Please or to participate in this conversation.