Tuesday, March 21, 2017

Laravel 5: Is there a non-case sensitive way to sort a collection by an attribute?

I'm struggling to sort an Eloquent collection using the sortBy() method. The issue is that the sorting is case sensitive and it first retrieves the uppercase results and then the lowercase ones, but what I'm trying to achieve is to sort every item no matter if it's uppercase or lowercase.



via Eseth

Advertisement