public function getIndex($doc) { try { $userId = null; if (Auth::check()) { $userId = Auth::user()->id; } $parentId = Input::get('parent_id'); $results = Comment::loadComments($doc, $parentId, $userId); } catch (Exception $e) { throw $e; App::abort(500, $e->getMessage()); } return Response::json($results); }