diff options
| author | horus | 2020-04-08 19:10:49 +0200 |
|---|---|---|
| committer | horus | 2020-04-08 19:10:49 +0200 |
| commit | 3484356137e16f98c40e0e3e55b4f3fc0630586c (patch) | |
| tree | 400f3f0355090676a99d794b10d1ebe3d677f1ef /app | |
| parent | 282cf037d94ef2b4f1e664d8fdf13d590fc8eb8d (diff) | |
| download | senpai-3484356137e16f98c40e0e3e55b4f3fc0630586c.tar.gz | |
Adds most surprising anime.
Diffstat (limited to 'app')
| -rw-r--r-- | app/Http/Controllers/AnimeController.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/Http/Controllers/AnimeController.php b/app/Http/Controllers/AnimeController.php index 76a870d..dbc41de 100644 --- a/app/Http/Controllers/AnimeController.php +++ b/app/Http/Controllers/AnimeController.php @@ -55,8 +55,15 @@ class AnimeController extends Controller { } public function showAllAnime() { - $anime = Anime::simplePaginate(); + $anime = new Anime; + $most_surprising_anime = $anime->setTable('view_anime_index'); + $most_surprising_anime = $most_surprising_anime->simplePaginate(10); - return view('index_anime', ["all_anime" => $anime]); + #$anime = $anime->setTable('anime'); + $anime = $anime->where('is_airing', 1); + $anime = $anime->orderBy('score_today', 'desc'); + $anime = $anime->simplePaginate(10); + + return view('index_anime', ["all_anime" => $anime, "most_suprising_anime" => $most_surprising_anime]); } } |
