Posts by Laerte • 148 points
2 posts
-
1
votes2
answers73
viewsA: Bug change position of banners site Laravel
You can try using Collections, maybe it gets easier. See if this helps: $banners = Banner::where('status', '=', true)->get()->sortBy('ordem'); $b = $banners->get($posicaoAntiga-1); $array =…
-
2
votes1
answer107
viewsA: Data sorting with php
You can use the sortBy method of a Collection, for this, create a Collection object from the array and sort: $collection = collect($array)->sortBy('ordem'); I hope it helps.…