/** * API to store a new reply */ public function apiStoreReply(ReplyRequest $request, Post $post) { logThis(auth()->user()->name . ' replied to ' . $post->title); $request->merge(['user_id' => auth()->user()->id]); $reply = $post->replies()->create($request->all()); return $reply; }