Skip to content

Commit

Permalink
Videos will be sorted after the given title
Browse files Browse the repository at this point in the history
  • Loading branch information
jonassiewertsen committed Mar 4, 2020
1 parent f38c5d0 commit 4b24f71
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Http/Controllers/VideosController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class VideosController {
public function index() {
$videos = Entry::whereCollection('how_to_addon_videos');

$videos = $this->sortByTitle($videos);

return view('howToAddon::videos.index', compact('videos'));
}

Expand All @@ -21,4 +23,8 @@ public function show($slug) {

return view('howToAddon::videos.show', compact('video', 'url'));
}

private function sortByTitle($videos) {
return collect($videos)->sortBy('title');
}
}

0 comments on commit 4b24f71

Please sign in to comment.