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
+1 -1
View File
@@ -57,7 +57,7 @@ class SubtitleController extends Controller
public function create(int $torrentId): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
{
$torrent = Torrent::withAnyStatus()->findOrFail($torrentId);
$mediaLanguages = MediaLanguage::all()->sortBy('name');
$mediaLanguages = MediaLanguage::orderBy('name')->get();
return view('subtitle.create', ['torrent' => $torrent, 'media_languages' => $mediaLanguages]);
}