Permalink
Browse files

Episode 38

  • Loading branch information...
JeffreyWay committed May 12, 2017
1 parent 064e973 commit 7cfbfe2f83c4a2071112887ff54a42b2ebe03713
@@ -12,7 +12,18 @@ class RepliesController extends Controller
*/
public function __construct()
{
$this->middleware('auth');
$this->middleware('auth', ['except' => 'index']);
}
/**
* Fetch all relevant replies.
*
* @param int $channelId
* @param Thread $thread
*/
public function index($channelId, Thread $thread)
{
return $thread->replies()->paginate(20);
}
/**
@@ -79,10 +79,7 @@ public function store(Request $request)
*/
public function show($channel, Thread $thread)
{
return view('threads.show', [
'thread' => $thread,
'replies' => $thread->replies()->paginate(20)
]);
return view('threads.show', compact('thread'));
}
/**
@@ -15,5 +15,8 @@
"laravel-mix": "^0.10.0",
"lodash": "^4.17.4",
"vue": "^2.1.10"
},
"dependencies": {
"moment": "^2.18.1"
}
}
Oops, something went wrong.

0 comments on commit 7cfbfe2

Please sign in to comment.