Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Disqus Widget Laravel Package

friendsofvictoire/disqus-widget

Laravel package that adds a Disqus comment widget to your application, with a Blade component and configurable shortname so you can drop threaded comments into any page. Simple setup and minimal overhead.

View on GitHub
Deep Wiki
Context7

Getting Started

First, the reality check: despite the naming, this is not a Laravel package. It is a Symfony bundle (FriendsOfVictoire\WidgetDisqusBundle) written for Victoire CMS, the Symfony 2/3-era CMS. There is no service provider, no facade, no config/disqus.php. If you are on Laravel, the answer is to embed Disqus directly (one <script> tag and a #disqus_thread div) — this package has nothing to offer you. The rest of this assessment assumes you are maintaining an existing Victoire site and have a real reason to use it.

Minimal steps for that case:

  1. composer require friendsofvictoire/disqus-widget (check the composer.json constraints first — it was last tagged in Nov 2016 and will pull against old Symfony/Victoire versions).
  2. Register the bundle the Symfony way for your version: new FriendsOfVictoire\WidgetDisqusBundle\WidgetDisqusBundle() in AppKernel::registerBundles() (Symfony <4) or in config/bundles.php (Symfony 4+).
  3. Clear the cache. Victoire discovers widgets through a compiler pass / DI tag, so a stale cache is the most common reason the widget does not appear in the editor.
  4. Create or edit a page in the Victoire backend, open the widget picker, and look for the Disqus widget.

Where to look first: the Widget/ directory (the widget class and its getName()/getForm() methods), then Resources/views/ for the Twig template that actually emits the Disqus embed, then DependencyInjection/ for any config keys such as the forum shortname. The widget class is the source of truth for what fields the editor form exposes.

First use case: drop a comment thread onto a blog article or news page template so editors can add/remove comments per page from the CMS UI without touching Twig.

Implementation Patterns

Editor-driven placement. The canonical workflow is not code — it's an editor opening a page in Victoire, dragging the Disqus widget into a slot, filling in the form (typically forum shortname plus a thread identifier/title), saving, and publishing. Your job as the developer is usually to make that form sane and the template correct, not to render it manually.

Per-page thread identity. The single most important implementation decision is the Disqus thread identifier. Use something stable and unique per content entity — the page slug, the business entity id, or a namespaced key like article-42 — passed into disqus_config:

var disqus_config = function () {
  this.page.url = '{{ page_url }}';
  this.page.identifier = '{{ thread_identifier }}';
};

Never derive the identifier from the current URL alone; the moment you change a route or move a page, every existing comment thread is orphaned. If the widget's form doesn't expose an identifier field, subclass the widget or add it to the form type — that is the intended extension point.

Shortname in config, not hardcoded. If the bundle supports a bundle-level config for the forum shortname, put it there (per environment) and let the widget override only when a site genuinely needs multiple forums. Hardcoding a shortname in the template makes staging and production indistinguishable, which causes cross-environment comment leakage.

Template override instead of editing vendor code. Override the widget Twig template through standard Symfony bundle inheritance (an app-level Resources/FriendsOfVictoireWidgetDisqusBundle/views/... path, or twig.paths precedence) so you can control lazy-loading, disqus_config, and consent gating without patching the vendor directory. This is also where you fix the embed if the bundle was written against the legacy Disqus embed and you now need the current one.

Fork-into-app as the maintenance pattern. Given the package's age (last release 2016, one star, zero dependents), the realistic long-term pattern is to copy the handful of files into your own src/ as a first-party bundle, keep the same widget name so existing page content still resolves, and then own the code. Treat the original as a scaffold, not a dependency you upgrade.

Gotchas and Tips

  • It will not install on anything modern. Symfony 2/3-era constraints, old PHP requirements, and a dependency on Victoire bundle versions that predate Symfony Flex. Expect Composer conflict resolution to fail on a current stack; do not fight it.
  • The project is effectively abandoned. One star, zero dependents, no release since November 2016. There will be no fixes for security issues, no compatibility with newer Disqus embed APIs, and no support. Budget for owning the code.
  • Widget missing from the editor is almost always a cache or registration problem, not a code problem. Run cache:clear, confirm the bundle is registered, and confirm the widget is tagged/discovered as Victoire expects. Check the widget's name string matches what the DI configuration references.
  • Blank Disqus box usually means a shortname mismatch, a #disqus_thread div that isn't present or is renamed, or a blocked script. Verify in the rendered HTML: the container id, the embed.js script load, and the shortname in the network request.
  • Localhost doesn't work. Disqus validates the hostname against the forum's configured domains; you'll get an empty or erroring embed in local dev. Test on a staging hostname registered in the Disqus admin.
  • Caching bites twice. Victoire caches rendered widgets/pages, and Disqus caches thread metadata. After template changes, clear the app cache; after identifier changes, expect new threads rather than migrated ones.
  • GDPR/CSP. Disqus sets third-party cookies and loads remote scripts. If you're in a consent regime, gate the embed behind a click-to-load placeholder rather than rendering it on page load — do this in your overridden template.
  • Debugging order: view source for the embed block → browser console for script errors → network tab for the Disqus request and shortname → Disqus admin for the forum's allowed domains. That sequence resolves nearly every issue faster than reading the (minimal) bundle code.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings