Add friend library comparison and game comments features
- CompareController: side-by-side library diff with stats (common games, rating diff) - GameCommentController + GameCommentPolicy: threaded comments with replies, auth-gated - GameComment model with top-level scope and self-referential replies relation - Migration: game_comments table with parent_id for threading - games/show: Discussion section with Alpine.js (post, reply, delete) - compare/show: tabbed view (in common, they have, you have) with game cards - users/show: "Compare Libraries" button visible to other authenticated users Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
3083071a6c
commit
14047dfe37
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Game;
|
||||
use App\Models\GameComment;
|
||||
use App\Models\Genre;
|
||||
use App\Models\Platform;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -54,7 +55,13 @@ class GameController extends Controller
|
||||
$userLists = auth()->user()->lists()->get(['id', 'title']);
|
||||
}
|
||||
|
||||
$response = view('games.show', compact('game', 'userGame', 'userReview', 'userLists'));
|
||||
$comments = $game->comments()->whereNull('parent_id')
|
||||
->with(['user', 'replies.user'])
|
||||
->latest()
|
||||
->limit(20)
|
||||
->get();
|
||||
|
||||
$response = view('games.show', compact('game', 'userGame', 'userReview', 'userLists', 'comments'));
|
||||
return auth()->check()
|
||||
? $response
|
||||
: response($response)->header('Cache-Control', 'public, max-age=300');
|
||||
|
||||
Reference in New Issue
Block a user