Skip to content

Configuration ​

All options live in config/vgcomment.php after:

bash
php artisan vendor:publish --tag=vgcomment-config

Many values can also be changed at runtime from Admin → Settings. Runtime DB settings override the file where applicable.

Languages ​

bash
php artisan vendor:publish --tag=vgcomment-lang

Translations: lang/vendor/vgcomment.

Routing & database ​

KeyDefaultNotes
prefixvgcommentsBase path: /vgcomments/...
connectionenv('VCOMMENT_DB_CONNECTION', 'mysql')Package migrations/models use this connection
table.*vgcomments, vgcomment_files, …Change before first migrate

Guests & targets ​

php
'allow_guests' => true,

// Empty = page_id only (recommended default)
'allowed_commentable_types' => [
    // \App\Models\Post::class,
],

// UI quick suggestions only — API accepts any emoji ≤ 32 chars
'reaction_types' => ['👍', '❤️', '😄', '😮', '😢', '😡'],

Morph comments only work for classes listed in allowed_commentable_types.

Reactions ​

reaction_types is not an allowlist. The reaction endpoint validates type as a string of length 1–32 so full Unicode emoji (including ZWJ sequences) work with the full picker in Blade and Livewire. Use the config list only as optional quick chips if your UI shows them.

User columns ​

Map your user model attributes:

php
'user_column_name' => 'name',
'user_column_email' => 'email',
'user_column_url' => 'url',
'user_column_avatar_url' => 'avatar_url',

Moderation ​

php
'moderation' => false,          // hold all new comments for approval
'moderation_users' => [
    'web' => [1],               // who can open /{prefix}/admin
],
'moderation_keys' => [],        // words → pending queue
'blacklist_keys' => [],         // words → spam

Content rules ​

php
'min_length' => 10,
'max_length' => 1000,
'throttle_max_rate' => 10,
'throttle_per_minutes' => 1,
'max_links' => 10,
'duplicates_check' => false,
'censor' => true,
'censors_text' => [],
'report_status' => 'pending',   // or 'spam'
'max_reports' => 5,

Avatars ​

php
'gravatar' => true,
'gravatar_imageset' => 'wavatar', // mp, identicon, monsterid, wavatar, retro, robohash, blank, 404

Uploads ​

php
'disk_filesystem' => config('filesystems.default', 'local'),
'upload_rules' => ['max:5120', 'mimes:doc,pdf,jpg,jpeg,png,gif'],
'upload_rules_max' => 5,

UI packages use two client paths against the same upload API:

  • Paperclip → keep the file as an attachment chip on the comment
  • Insert image / paste / drop → insert Markdown ![](stream-url) into the comment body

Stream URLs use GET /{prefix}/files/{uuid}.{extension} (see REST API).

NSFW (Sightengine) ​

php
'nsfw' => false,
'nsfw_api_user' => '',
'nsfw_api_key' => '',

reCAPTCHA v3 ​

php
'recaptcha' => false,
'recaptcha_key' => env('RECAPTCHA_KEY', ''),
'recaptcha_secret' => env('RECAPTCHA_SECRET', ''),
bash
RECAPTCHA_KEY=your-site-key
RECAPTCHA_SECRET=your-secret

UI packages load Google’s script when recaptcha is enabled.

Broadcast ​

php
'broadcast' => false,

Optional realtime for Livewire (Echo). Leave off unless you configure broadcasting.

Env cheat sheet ​

bash
VCOMMENT_DB_CONNECTION=mysql
RECAPTCHA_KEY=
RECAPTCHA_SECRET=

MIT · Blade-first for 2.x · Livewire 4 supported