From 05f659896d903e1ff41dba810f125d721fa057e7 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 19 Sep 2019 20:27:30 -0600 Subject: [PATCH] Update CommentController, remove unused show method and update showAll method --- app/Http/Controllers/CommentController.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/CommentController.php b/app/Http/Controllers/CommentController.php index 586aacc72..38c177562 100644 --- a/app/Http/Controllers/CommentController.php +++ b/app/Http/Controllers/CommentController.php @@ -21,21 +21,13 @@ use League\Fractal\Pagination\IlluminatePaginatorAdapter; class CommentController extends Controller { - public function show(Request $request, $username, int $id, int $cid) - { - $user = Profile::whereUsername($username)->firstOrFail(); - $status = Status::whereProfileId($user->id)->whereInReplyToId($id)->findOrFail($cid); - - return view('status.reply', compact('user', 'status')); - } - public function showAll(Request $request, $username, int $id) { - $user = Profile::whereUsername($username)->firstOrFail(); - $status = Status::whereProfileId($user->id)->findOrFail($id); - $replies = Status::whereInReplyToId($id)->paginate(40); + $profile = Profile::whereNull(['status', 'domain'])->whereUsername($username)->firstOrFail(); + $status = Status::whereProfileId($profile->id)->findOrFail($id); + $replies = Status::whereInReplyToId($id)->simplePaginate(40); - return view('status.comments', compact('user', 'status', 'replies')); + return view('status.comments', compact('profile', 'status', 'replies')); } public function store(Request $request)