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

Activity Comments Livewire Laravel Package

liberusoftware/activity-comments-livewire

Livewire components for adding threaded comments to activity feeds in Laravel apps, with real-time updates and simple Blade integration.

View on GitHub
Deep Wiki
Context7

Getting Started

This package is a presentation adapter — it does not implement activity logging or comments itself. It ships Livewire components and Blade views that sit on top of the Liberu activity/comments domain layer. Treat it as the UI half of a two-package install.

Minimal path:

  1. Confirm the domain dependency first. Open the package's composer.json and read require. You will almost certainly need the corresponding core module (e.g. liberusoftware/activity-comments or a module-activity-comments package) plus livewire/livewire. Installing this adapter alone gives you views with no data source.
  2. Install into a modular Laravel app. composer require liberusoftware/activity-comments-livewire. If the app uses nwidart/laravel-modules, verify the module is discovered (php artisan module:list) — Liberu packages are built around that structure and the service provider may assume module registration.
  3. Check what the provider registers. In the service provider, look for Livewire::component(...) calls. That alias list is your actual public API — it tells you the component names to drop into Blade (<livewire:... />) far faster than reading the views.
  4. Publish what's publishable. php artisan vendor:publish --provider="...ActivityCommentsLivewireServiceProvider" and inspect the tags offered. Config and views are the two you'll usually want locally so you can override markup without forking.
  5. First use case: render a comment thread on an existing model. Add the package's trait/interface (check the domain package for the contract — typically something like HasComments / HasActivity) to your Eloquent model, migrate, then embed the thread component with the model as a parameter:
<livewire:activity-comments.thread :model="$post" />

If that renders an empty-but-working shell, your wiring is correct and remaining work is authorization and styling.

Where to look first, in order: composer.json (dependency graph) → service provider (component aliases, config merge) → resources/views (what data each component actually expects) → the domain package's models and contracts.

Implementation Patterns

Component-per-concern, not one mega-widget. These adapters typically split into an activity feed, a comment list, and a comment form. Compose them in your own Blade rather than relying on a single bundled "everything" component — it keeps Livewire payloads small and lets you place the form in a sidebar or modal.

Pass models, not IDs, where possible. Livewire's model binding gives you route-level authorization for free via the authorize()/AuthorizesRequests behaviour. If the package only accepts $commentableId + $commentableType, wrap it in your own thin component that resolves and authorizes the model first. This is the single biggest security lever you have with a 0-star package.

Feed pattern — cursor over offset. Activity feeds grow unboundedly. If the bundled component uses paginate(), prefer cursorPaginate() in your own subclass or a wrapper; deep offset pagination on an activity table degrades fast and LoadMore-style buttons re-render the entire list otherwise.

Event-driven refresh. Let the comment form dispatch an event ($this->dispatch('comment-created')) and have the list #[On('comment-created')] re-fetch, rather than emitting a full-page redirect. This keeps the adapter components decoupled and is the intended Livewire 3 idiom. Verify which Livewire major the package targets before copying this — Livewire 2 uses $emit/$listeners.

Polymorphic scoping in queries. Activity/comment tables are polymorphic (commentable_type, commentable_id). Set a morphMap in a service provider so stored types are stable aliases (post, not App\Models\Post). Retrofitting this after data exists is painful, and it affects authorization checks that branch on type.

Render strategy for feeds. For activity lists that users see on every page load, consider @livewire(..., lazy: true) or rendering the first page server-side and letting Livewire take over on interaction. Pure-Livewire feeds cost a full component hydration on first paint.

Styling integration. These adapters usually ship Tailwind-marked-up views with no CSS build of their own. Point your Tailwind content config at vendor/liberusoftware/**/resources/views/**/*.blade.php or the published views, otherwise the components render unstyled and you'll spend an hour debugging "missing classes."

Authorization as a policy layer, not inline checks. Put create/update/delete gates on the Comment model via a CommentPolicy and reference them consistently. Do not rely on the adapter to check permissions — presentation packages frequently assume the host app has already gated the route.

Gotchas and Tips

  • Zero stars, zero dependents means zero field-testing. Read the source before trusting it. Budget time for a full read of the components (~a few hundred lines in packages of this shape); it is cheaper than debugging surprises in production.
  • Livewire major version coupling is the most likely breakage. Livewire 3 changed event APIs, wire: directives, and component registration. Check the adapter's composer.json constraint and pin it; do not let a composer update drift Livewire under a package that hasn't declared support.
  • NOASSERTION license. The repo has no machine-detectable license. Before commercial use, confirm licensing with the maintainer or treat it as unlicensed. This is a legal blocker, not a nitpick.
  • Future-dated release (2026-10-26). That timestamp is almost certainly a bad tag or a placeholder. Don't infer stability from it; check the actual commit history and whether the tag resolves to a real commit.
  • N+1 on comment authors. Comment lists eager-load the commentable but often forget with('user') / with('creator'). Add protected $with = ['user'] on your model or override the query — the adapter's views won't do it for you.
  • View override resolution. Published views win over vendor views, but only if the publish tag actually copied them. If your overrides appear ignored, run php artisan view:clear and verify the path in config/view.php paths matches where the publisher wrote them.
  • Config merge surprise. mergeConfigFrom means your published config can go stale relative to package defaults. After upgrading, diff the package's config/ against your published copy.
  • Debugging tip: Livewire component errors surface as a blank region without APP_DEBUG. Use Livewire::listen or the browser's network tab to inspect the /livewire/update response body — the JSON contains the real exception when the rendered error is swallowed.
  • Extension points to prefer: published views, published config, and subclassing the components. Avoid editing vendor/ — you'll lose everything on the next composer install, and with no dependents there's no community pressure keeping those files stable.
  • Testing: with no test suite of your own around it, add at minimum a Livewire test for the comment-create path (Livewire::test(...)->set(...)->call('save')->assertHasNoErrors()) and an authorization test proving an unauthorized user cannot post to another user's model. That covers the two failure modes that actually hurt.
  • Fallback plan. Given the low maturity signals, structure your integration so the adapter is swappable: keep your own Blade wrappers thin, keep authorization and business rules outside the components, and you can replace the presentation layer without touching domain 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.
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
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin