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.
Architecture fit
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.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.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
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.Technical risk
withCount on hot content is a known scaling pain point. Whether the package ships any aggregation/caching layer determines if we build one ourselves.morphMap aliasing, need explicit verification.Key questions
withCount helpers for aggregates, and any counter-cache, or must we denormalize?Stack fit
Migration path
Compatibility
Sequencing
Maintenance
Support
Scaling
created_at is a reasonable future lever; confirm the schema doesn't preclude it.Failure modes
morphMap aliases silently orphans existing rows.Ramp-up
How can I help you explore Laravel packages today?