@param Comment $comment
@param Request $request

@return \Illuminate\Http\RedirectResponse
481732
public function save(Comment $comment, Request $request)
    {
        $comment
            ->fill($request->get('comment'))
            ->save();

        Alert::info(__('Comment was saved'));

        return redirect()->route('platform.systems.comments');
    }
25857
public void postComment(int id, int rating, String comment) {
        ClientResource resource = new ClientResource(Route.ADD_COMMENT.url(id));
        resource.setChallengeResponse(this.auth.toChallenge());

        Form form = new Form();
        if (id > 0)
            form.add("rating", String.valueOf(rating));
        if (comment != null && comment.length() > 0)
            form.add("comment", comment);

        resource.post(form);
    }
535122
public function changeComment($comment)
    {
        $this->actions->addAction(new ChangeComment($this->table, $comment));

        return $this;
    }
155702
private function createRedirectResponse(Request $request)
    {
        $url = $this->loginUrl.'?'.http_build_query([
            'redirect_to' => $request->getUri(),
            'reauth'      => 0,
        ]);

        return RedirectResponse::create($url, 302);
    }
1018047
public function update(CommentsServiceContract $commentsService, SaveCommentRequestContract $request, int $id = 0): SaveResponseContract
    {
        return $this->save($commentsService, $request, $id);
    }
359732
public function getComment($comment_id)
    {
        list($response, $statusCode, $httpHeader) = $this->getCommentWithHttpInfo ($comment_id);
        return $response; 
    }
518806
public function commentModerationAction($commentId, $hash, $status)
    {
        $action = $this->container->get(ModerateCommentAction::class);

        return $action($commentId, $hash, $status);
    }
1181937
def post_comment_ajax(request, using=None):
    
    if not request.is_ajax():
        return HttpResponseBadRequest("Expecting Ajax call")

    # This is copied from django_comments.
    # Basically that view does too much, and doesn't offer a hook to change the rendering.
    # The request object is not passed to next_redirect for example.
    #
    # This is a separate view to integrate both features. Previously this used django-ajaxcomments
    # which is unfortunately not thread-safe (it it changes the comment view per request).

    # Fill out some initial data fields from an authenticated user, if present
    data = request.POST.copy()
    if request.user.is_authenticated:
        if not data.get('name', ''):
            data["name"] = request.user.get_full_name() or request.user.username
        if not data.get('email', ''):
            data["email"] = request.user.email

    # Look up the object we're trying to comment about
    ctype = data.get("content_type")
    object_pk = data.get("object_pk")
    if ctype is None or object_pk is None:
        return CommentPostBadRequest("Missing content_type or object_pk field.")
    try:
        model = apps.get_model(*ctype.split(".", 1))
        target = model._default_manager.using(using).get(pk=object_pk)
    except ValueError:
        return CommentPostBadRequest("Invalid object_pk value: {0}".format(escape(object_pk)))
    except (TypeError, LookupError):
        return CommentPostBadRequest("Invalid content_type value: {0}".format(escape(ctype)))
    except AttributeError:
        return CommentPostBadRequest("The given content-type {0} does not resolve to a valid model.".format(escape(ctype)))
    except ObjectDoesNotExist:
        return CommentPostBadRequest("No object matching content-type {0} and object PK {1} exists.".format(escape(ctype), escape(object_pk)))
    except (ValueError, ValidationError) as e:
        return CommentPostBadRequest("Attempting go get content-type {0!r} and object PK {1!r} exists raised {2}".format(escape(ctype), escape(object_pk), e.__class__.__name__))

    # Do we want to preview the comment?
    is_preview = "preview" in data

    # Construct the comment form
    form = django_comments.get_form()(target, data=data, is_preview=is_preview)

    # Check security information
    if form.security_errors():
        return CommentPostBadRequest("The comment form failed security verification: {0}".format(form.security_errors()))

    # If there are errors or if we requested a preview show the comment
    if is_preview:
        comment = form.get_comment_object() if not form.errors else None
        return _ajax_result(request, form, "preview", comment, object_id=object_pk)
    if form.errors:
        return _ajax_result(request, form, "post", object_id=object_pk)

    # Otherwise create the comment
    comment = form.get_comment_object()
    comment.ip_address = request.META.get("REMOTE_ADDR", None)
    if request.user.is_authenticated:
        comment.user = request.user

    # Signal that the comment is about to be saved
    responses = signals.comment_will_be_posted.send(
        sender=comment.__class__,
        comment=comment,
        request=request
    )

    for (receiver, response) in responses:
        if response is False:
            return CommentPostBadRequest("comment_will_be_posted receiver {0} killed the comment".format(receiver.__name__))

    # Save the comment and signal that it was saved
    comment.save()
    signals.comment_was_posted.send(
        sender  = comment.__class__,
        comment = comment,
        request = request
    )

    return _ajax_result(request, form, "post", comment, object_id=object_pk)
1208032
public function rootRedirectAction(Request $request)
    {
        $uri = $request->getUri();
        // Special case, not correctly setup yet. Do so now.
        if (!$this->isInstalled()) {
            return new RedirectResponse($uri . 'install.html');
        }

        return new RedirectResponse($uri . 'index.html');
    }
398266
public function destroy(CommentRequest $request, Comment $comment)
    {
        try {

            $comment->delete();
            return $this->response->message(trans('messages.success.deleted', ['Module' => trans('blog::comment.name')]))
                ->code(202)
                ->status('success')
                ->url(guard_url('blog/comment/0'))
                ->redirect();

        } catch (Exception $e) {

            return $this->response->message($e->getMessage())
                ->code(400)
                ->status('error')
                ->url(guard_url('blog/comment/' . $comment->getRouteKey()))
                ->redirect();
        }

    }
359496
public function dispatchCommentDeleteEvent(Post $post, Comment $comment)
    {
        $event = new LogCommentDeleteEvent($post, $comment);

        return $this->dispatch($event);
    }
353467
public function redirectAction(Request $request, Error404 $error404)
    {
        $redirection = new ErrorRedirection();
        $redirection->setError($error404);

        $form = $this->getError404RedirectionForm($redirection);
        $form->handleRequest($request);

        if ($request->query->get('novalidate', false) === false) {
            if ($form->isValid()) {
                if ($redirection->getLink()->getLinkType() !== Link::TYPE_NONE) {
                    $error404->setRedirection($redirection);
                    $redirection->setError($error404);
                    $redirection->setUrl($error404->getUrl());

                    $em = $this->getDoctrine()->getManager();
                    $em->persist($redirection);
                    $em->flush();

                    $this->congrat($this->get('translator')->trans('victoire.404.redirection.success'));

                    return $this->returnAfterRemoval($error404);
                }

                $form->addError(new FormError($this->get('translator')->trans('victoire.404.form.error.blank')));
            }

            $this->warn($this->get('translator')->trans('victoire.404.form.error.unvalid'));

            return new Response($this->renderView('@VictoireSeo/Error404/_list.html.twig', [
                'form'     => $form->createView(),
                'error'    => $error404,
                'isOpened' => true,
            ]), 200, [
                'X-Inject-Alertify' => true,
            ]);
        }

        // rebuild form to avoid wrong form error
        $form = $this->getError404RedirectionForm($redirection);

        return new JsonResponse([
            'html' => $this->renderView('@VictoireSeo/Error404/_list.html.twig', [
                'form'     => $form->createView(),
                'error'    => $error404,
                'isOpened' => true,
            ]),
        ]);
    }
271811
function editComment($commentId, array $comment)
    {
        $params = array(1, $this->username, $this->password, $commentId, $comment);

        return $this->sendRequest('wp.editComment', $params);
    }
611179
public function updateComment(int $commentId, string $content): bool
    {
        if ('' === $content || ! $this->validateId($commentId)) {
            return false;
        }

        $data   = $this->prepareRequestData(['content' => $content]);
        $result = $this->post('comments/' . $commentId, $data);

        return 204 === $result->getStatusCode();
    }
278668
public function addCommentAction($id, Request $request = null)
    {
        $action = $this->container->get(CreateCommentAction::class);

        return $action($this->resolveRequest($request), $id);
    }
491100
public function doAction(Request $request)
    {
        $token = $this->payum->getHttpRequestVerifier()->verify($request);

        $gateway = $this->payum->getGateway($token->getGatewayName());
        $gateway->execute(new Refund($token));

        $this->payum->getHttpRequestVerifier()->invalidate($token);

        return new RedirectResponse($token->getAfterUrl());
    }
712361
public function dispatchCommentPublishEvent(Post $post, Comment $comment)
    {
        $event = new LogCommentPublishEvent($post, $comment, $this->translator);

        return $this->dispatch($event);
    }