From dc3cbbfdd9455e419eaaf776c16544afdf95eadb Mon Sep 17 00:00:00 2001 From: Developer Date: Sat, 27 Jun 2026 04:12:21 +0200 Subject: feat: add Hacker News stories section to movie detail page Links to every HN story referencing this movie, ordered by most recent. Each entry shows date, score (if > 0), and descendants (if > 0). --- app/Http/Controllers/CinemaController.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'app/Http') diff --git a/app/Http/Controllers/CinemaController.php b/app/Http/Controllers/CinemaController.php index 8a9bb0e..d8adefa 100644 --- a/app/Http/Controllers/CinemaController.php +++ b/app/Http/Controllers/CinemaController.php @@ -94,12 +94,29 @@ class CinemaController extends Controller $directors = $casts->where('profession', 'director'); $screenwriters = $casts->where('profession', 'screenwriter')->take(3); + $hnStories = DB::connection('cinema') + ->table('links') + ->join('story', 'story.id', '=', 'links.story_id') + ->select( + 'story.story_id', + 'story.title', + 'story.score', + 'story.descendants', + 'story.time' + ) + ->where('links.host', 'www.imdb.com') + ->where('links.field', 1) + ->where('links.param', $id) + ->orderBy('story.time', 'desc') + ->get(); + return view('cinema_show', [ 'movie' => $movie, 'genres' => $genres, 'actors' => $actors, 'directors' => $directors, 'screenwriters' => $screenwriters, + 'hnStories' => $hnStories, ]); } -- cgit v1.2.3