PHPackages                             positron48/bolt-simple-comments - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. positron48/bolt-simple-comments

ActiveBolt-extension

positron48/bolt-simple-comments
===============================

It is bolt extension for simple comments system.

v1.0.10(6mo ago)1572[1 PRs](https://github.com/positron48/bolt-simple-comments/pulls)MITPHPPHP &gt;=7.1.3

Since Jun 2Pushed 6mo agoCompare

[ Source](https://github.com/positron48/bolt-simple-comments)[ Packagist](https://packagist.org/packages/positron48/bolt-simple-comments)[ RSS](/packages/positron48-bolt-simple-comments/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (12)Used By (0)

Positron48 CommentExtension
===========================

[](#positron48-commentextension)

Author: Anton Filatov.

This Bolt extension can be used as comment system.

Installation:
-------------

[](#installation)

```
composer require positron48/bolt-simple-comments
php bin/console doctrine:migrations:migrate
php bin/console cache:clear --no-warmup
```

Command `cache:clear` needs to refresh admin pages list.

### Using google recaptcha enterprise

[](#using-google-recaptcha-enterprise)

If you want to use Google recaptcha enterprise - get the api key via [this guide](https://cloud.google.com/recaptcha-enterprise/docs/set-up-non-google-cloud-environments-api-keys?hl=en_US) and next steps:

- go to  and create new service account;
- select to your service account role `reCaptcha Enterprise Agent`;
- go to service account and create new JSON key;
- store credentials in /config/extensions/service-account-recaptcha-credentials.json or change variable `GOOGLE_APPLICATION_RECAPTHA_CREDENTIALS` in your .env file. Default value is `../config/extensions/service-account-recaptcha-credentials.json`.

Add to .env file some parameters:

```
RECAPTCHA_KEY=
GOOGLE_API_KEY=
GOOGLE_PROJECT_ID=
GOOGLE_APPLICATION_RECAPTHA_CREDENTIALS=../config/extensions/service-account-recaptcha-credentials.json
```

`RECAPTCHA_KEY` - Key Id of [your recaptcha enterprise](https://console.cloud.google.com/security/recaptcha) key.

`GOOGLE_API_KEY` - Api key from section 'API Keys' in [Credentials](https://console.cloud.google.com/apis/credentials) page.

`GOOGLE_PROJECT_ID` - Project Id of your project in [Google Cloud Platform](https://console.cloud.google.com/iam-admin/settings).

`GOOGLE_APPLICATION_RECAPTHA_CREDENTIALS` - path to your json file with credentials.

Usage
-----

[](#usage)

After installation in your admin panel /bolt you will see a new menu item called "Comments". There are all comments with edit ability.

To show comment list on contentpage use twig function `commentList` with content as first param:

```
{{ commentList(content) }}
```

Also you can override default template by creating file `comment_list.html.twig` in your theme folder.

Spam Filtering
--------------

[](#spam-filtering)

You can enable simple spam filtering for comments using a configurable regular expression. This is controlled by the `COMMENT_SPAM_REGEX` environment variable.

### How to configure

[](#how-to-configure)

Add the following line to your `.env` file (or set it in your Docker environment):

```
COMMENT_SPAM_REGEX='/\
