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

Laravel Reactions Laravel Package

hkp22/laravel-reactions

Add reactions such as likes, loves, and more to any Eloquent model in your Laravel app. The package offers polymorphic, customizable reaction types, simple model traits, and a clean API for attaching, toggling, and counting reactions. Great for posts, comments, and social features.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • The package follows the idiomatic Laravel package contract: a service provider, publishable config and migrations, and trait-based composition (HasReactions on reactable models, a reactor trait on User). This maps cleanly onto our existing Eloquent domain layer without requiring us to adopt a new persistence abstraction or a competing ORM pattern.
  • The underlying model is almost certainly a polymorphic pivot (reactable_type/reactable_id + reactor_id + reaction type), which is the correct shape for "any model can be reacted to." It composes with existing models rather than forcing an inheritance hierarchy, so it will coexist with our current Post, Comment, and Article models without refactoring.
  • Reaction types (like/dislike/love/etc.) being a first-class concern rather than a boolean is the main architectural differentiator versus a simple likes table. That is a product decision we should confirm we actually need before adopting; if we only ever need a single "like," this package is over-specified but still harmless.

Integration feasibility

  • Low-friction: composer require, publish config/migration, add traits to 2–4 models, run migration. No changes to existing tables, no data backfill required for greenfield usage.
  • The main integration cost is not the package, it is the surface area: controllers, policies, API resources, and front-end optimistic UI all need endpoints and authorization for "react / unreact / switch reaction." That work dominates the estimate.
  • Compatibility risk is concentrated in the Laravel version matrix and PHP version floor. We must verify support for our exact framework version and confirm the migration is compatible with our DB engine (MySQL vs Postgres vs SQLite for CI).

Technical risk

  • Maintainer/bus-factor risk (high). ~195 stars and a single maintainer means no SLA, no security response process, and a real chance of abandonment. This is the dominant risk, not code quality.
  • Release metadata anomaly (medium). The listed last release date (2026-04-27) is future-dated relative to a normal review cycle. Verify the tag, changelog, and that the tagged commit matches the published archive before adopting; treat it as a signal to audit the release process.
  • Write-path concurrency (medium). Reaction toggles are inherently race-prone. We need to confirm a unique constraint over (reactable, reactor, type) and whether toggling is idempotent or uses upsert, so double-taps and retries don't produce duplicate rows or inflated counts.
  • Read-path performance (medium). Polymorphic withCount on hot content is a known scaling pain point. Whether the package ships any aggregation/caching layer determines if we build one ourselves.
  • Lifecycle correctness (medium). Orphaned reactions on hard/soft delete of reactables or reactors, and behavior of morphMap aliasing, need explicit verification.
  • Code audit required (medium). We should read the migration and trait source directly — it is small enough — rather than trusting the README.

Key questions

  1. Does the migration define a unique index on (reactable_type, reactable_id, reactor_id, type), and is the toggle operation atomic/upsert-based?
  2. How are reaction types defined — PHP enum, config array, or a DB lookup table? Can we constrain the allowed set per model?
  3. Does it expose query scopes / withCount helpers for aggregates, and any counter-cache, or must we denormalize?
  4. Are domain events dispatched on react/unreact for webhooks, notifications, and analytics?
  5. How are authorization and "can this user react to this model" handled — policy hooks or left entirely to us?
  6. What is the supported Laravel/PHP version matrix, and is there a CI matrix proving it?
  7. What is the test coverage and does it cover concurrency, soft deletes, and morph maps?
  8. Is there any rate limiting or spam-abuse affordance, or is that fully our responsibility?

Integration Approach

Stack fit

  • Fits our Laravel/PHP stack natively with no new runtime dependency beyond Composer. No queue, cache, or external service is implied, which keeps it inside our existing deployment topology.
  • Works with our existing relational store; the only schema delta is one new table plus indexes. If we run multi-tenant, confirm the table is either tenant-scoped by convention or that we can add a tenant column without forking.

Migration path

  • Phase 1 (greenfield models only): adopt on new/low-traffic models behind a feature flag. No existing data to reconcile, so blast radius is minimal.
  • Phase 2 (retrofit existing "likes"): if we already have a likes table, plan a dual-write or one-shot backfill mapping legacy rows to the new polymorphic shape, with a reversible read path. Do not cut over in the same release.
  • Phase 3 (retire legacy): drop old table only after a full read-path migration and a soak period.

Compatibility

  • Two compatibility axes matter: framework/PHP version support, and coexistence with any existing reaction/like package. Running both simultaneously is the highest-risk configuration and should be time-boxed.
  • Verify migration compatibility with CI's SQLite (index length, enum emulation) early — this is a common late-stage CI break.

Sequencing

  1. Source audit of migration, traits, and config (0.5–1 day) — gate for go/no-go.
  2. Spike on one model in a throwaway branch, including double-tap/race test.
  3. Add endpoints + policies + API resources + tests.
  4. Add read-path aggregates (withCount or counter cache) and load-test hot-content queries.
  5. Backfill legacy data if applicable; soak; retire old path.
  6. Document runbook and, if bus-factor risk is unacceptable, vendor the package into our repo.

Operational Impact

Maintenance

  • Small, stable surface: one table, two traits, one config. Low ongoing maintenance if we vendor or pin a commit rather than tracking upstream.
  • Single-maintainer abandonment is the realistic scenario. Recommendation: pin to a specific tag or commit hash, and budget a one-time internal fork (~50–100 LOC) if the package stops receiving updates. MIT license makes this cheap.
  • Migration ownership: once the migration is published into our repo, it is ours. That is good for stability and bad for upstream schema fixes.

Support

  • No commercial support, no SLA, community issues only. Acceptable for a non-revenue-critical feature; not acceptable for anything requiring uptime guarantees tied to reaction counts.
  • Internal escalation path must be "we read the source," not "we file an issue." Ensure at least two engineers can reason about the table.

Scaling

  • The reaction table is high-write, low-cardinality, and grows monotonically with engagement — it will become one of our largest tables by row count. Plan index strategy up front (composite on reactable + type; separate index on reactor for "my reactions" views).
  • Read scaling is the real constraint: aggregate counts on hot content pages will hammer the table. Adopt a denormalized counter or cached aggregate from day one rather than retrofitting under load.
  • If reaction events feed feeds/notifications/analytics, route through the queue; do not emit synchronous side effects in the request path.
  • Archival/partitioning by created_at is a reasonable future lever; confirm the schema doesn't preclude it.

Failure modes

  • Duplicate reactions / count drift from concurrent toggles without a unique constraint — surfaces as inflated counts, hard to detect, harder to repair.
  • N+1 or unbounded aggregate queries on list pages — classic latency cliff as content volume grows.
  • Orphaned rows after model deletion or soft-delete without cascade — silently degrades aggregate accuracy.
  • Morph map drift — renaming a model class or changing morphMap aliases silently orphans existing rows.
  • Type drift — if reaction types live in config or an enum, deploying a code change that removes a type can break reads of historical rows.
  • Vendor abandonment mid-cycle — mitigated by pinning and by our ability to fork.

Ramp-up

  • Low for the happy path: a mid-level Laravel engineer can wire up traits, endpoints, and tests in ~2–3 days.
  • Add ~2–3 days for concurrency hardening, aggregate/caching strategy, and legacy backfill if applicable. Total realistic first-mile: one sprint-week for one engineer including the source audit.
  • No new operational tooling or on-call knowledge required — it is a table in a database we already run.
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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource