I have collection with subcollections like:
+
+--- name: 1a8 Lorem Ipsum
+
+--- name: 1a2 Lorem Ipsum
+
+--- name: 1a10 Lorem Ipsum
and now I want to sort it by this name:
$collection->sortBy('name')
It should be:
1a2 Lorem Ipsum
1a8 Lorem Ipsum
1a10 Lorem Ipsum
but I'm getting:
1a10 Lorem Ipsum
1a2 Lorem Ipsum
1a8 Lorem Ipsum
Why? I have tried too with $collection->sortBy('name', SORT_NATURAL, false) but it's same effect.
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2nXRO5J
via IFTTT
Aucun commentaire:
Enregistrer un commentaire