I have a little problème on sorting an array according to a value using Laravel, what i did is converting it into a collection with:
$array = collect($array)
Then i sorted it with:
$array = collect($array)->sortBy($sortingValue)
The result here is a collection, so the next step was to get my data as an array back again:
$array = collect($array)->sortBy($sortingValue)->values()
I then wrote this code between semicolons because it's nested in an html code, so got something like this:
{{$array = collect($array)->sortBy($sortingValue)->values()}}
This is working pretty good, i do have my array sorted according to the parameter i pasted to the function, the problem i have is that this is causing the results to show up on my page in a text format, at the place im executing this code!
Any idea on where this comes from ? im pretty sure it's because of the nested code, but i didn't figure out how to hide that text from my page, and only use the results for the rest of my project.
Thank you.
; ... ;semicolons? just trying to figure out what semicolons have to do with this at the moment :)