refactor: swap sorting in laravel to ordering in the database

This commit is contained in:
Roardom
2023-06-19 08:13:39 +00:00
parent 80428fdc88
commit 1fa4a3e506
22 changed files with 63 additions and 62 deletions
@@ -26,7 +26,7 @@ class ResolutionController extends Controller
*/
public function index(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
$resolutions = Resolution::all()->sortBy('position');
$resolutions = Resolution::orderBy('position')->get();
return view('Staff.resolution.index', ['resolutions' => $resolutions]);
}