From d9ec94ba65adc1abbd5becae4616b9145a740dee Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 9 Aug 2018 20:04:48 -0600 Subject: [PATCH] Update CommentController, add showAll() method --- app/Http/Controllers/CommentController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Http/Controllers/CommentController.php b/app/Http/Controllers/CommentController.php index 70a7825bd..2cfb4f4cc 100644 --- a/app/Http/Controllers/CommentController.php +++ b/app/Http/Controllers/CommentController.php @@ -18,6 +18,14 @@ class CommentController extends Controller 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); + return view('status.comments', compact('user', 'status', 'replies')); + } + public function store(Request $request) { if(Auth::check() === false) { abort(403); }