I have a column of type “varchar” but it consists of integer.
When I make a query with orderBy, it results like below.
10
11
12
9
I have implemented orderBy like below:
->orderBy("stdmap.prvid");
When I run query directly in phpmyadmin with order stdmap.prvid+0, it is giving me correct result. But I am not sure how to add +0 in laravel query.
3
Answers
Try this:
It should work.
How about with
orderByRaw
?Order the resulting collection
Hope this helps