src/CommentsController.php
public function update(Request $request, Comment $comment)
    {
        $this->authorize('edit-comment', $comment);

        $this->validate($request, [
            'message' => 'required|string'
        ]);

        $comment->update([
            'comment' => $request->message
        ]);

        return redirect()->to(url()->previous() . '#comment-' . $comment->id);
    }
public function update(Request $request, Comment $comment)
    {
        $this->authorize('edit-comment', $comment);

        $this->validate($request, [
            'message' => 'required|string'
        ]);

        $comment->update([
            'comment' => $request->message
        ]);

        return redirect()->to(url()->previous() . '#comment-' . $comment->id);
    }
public function update ( Request $ request , Comment $ comment ) { $ this -> authorize ( 'edit-comment' , $ comment ) ; $ this -> validate ( $ request , [ 'message' => 'required|string' ] ) ; $ comment -> update ( [ 'comment' => $ request -> message ] ) ; return redirect ( ) -> to ( url ( ) -> previous ( ) . '#comment-' . $ comment -> id ) ; }
Updates the message of the comment.
Updates the message of the comment .