Skip to content

Deploy & assets

Most “comments look unstyled” issues are missing published files under public/vendor/.

Required folders

PackagePublish tagOutput
vgcommentsvgcomment-assetspublic/vendor/vgcomments/
livewire-commentsvgcomment-assets-livewirepublic/vendor/livewire-comments/
blade-commentsvgcomment-assets-bladepublic/vendor/blade-comments/

Minimum files:

public/vendor/vgcomments/css/style.css
public/vendor/vgcomments/js/app.js

public/vendor/livewire-comments/css/comments.css
public/vendor/livewire-comments/js/comments.js

public/vendor/blade-comments/css/comments.css
public/vendor/blade-comments/js/comments.js

Publish on the server

bash
php artisan vendor:publish --tag=vgcomment-assets --force
php artisan vendor:publish --tag=vgcomment-assets-livewire --force   # if using Livewire UI
php artisan vendor:publish --tag=vgcomment-assets-blade --force      # if using Blade UI
php artisan optimize:clear

Or rsync/copy public/vendor/ from a build machine. Do not confuse this with Composer’s vendor/ directory.

Blade directives

DirectiveLoads
@commentStyles / @commentScriptsLivewire UI assets
@commentBladeStyles / @commentBladeScriptsBlade UI assets

They point at asset('vendor/...'). If the file is missing, the browser gets 404 and the UI falls back to raw HTML controls.

Load these directives only on pages that show comments. Do not put them in global guest/login layouts — that caused invisible login buttons when Tailwind/Plyr styles leaked in earlier 1.x builds.

Production checklist

  1. APP_ENV=production, APP_DEBUG=false
  2. Correct APP_URL (and ASSET_URL if you use a CDN)
  3. composer install --no-dev
  4. Migrate, then cache config/routes/views
  5. Web server document root = public/
  6. Confirm vendor CSS URLs return 200

Example:

bash
curl -I https://your-domain/vendor/blade-comments/css/comments.css

Auto-publish after Composer update

json
{
  "scripts": {
    "post-update-cmd": [
      "@php artisan vendor:publish --tag=vgcomment-assets --force",
      "@php artisan vendor:publish --tag=vgcomment-assets-livewire --force",
      "@php artisan vendor:publish --tag=vgcomment-assets-blade --force"
    ]
  }
}

Only keep the tags you actually use.

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