overtrue/laravel-like
A Laravel package for adding like, unlike, and favorite functionality to Eloquent models. Simple traits let users like any model, check liked status, count likes, and query liked items through clean, expressive APIs.
Architecture fit
overtrue/laravel-like is a narrow, single-purpose Eloquent extension: a HasLike trait, a Like model, and one migration providing polymorphic many-to-many "like/favorite" relationships between models.Integration feasibility
Technical risk
Key questions
Stack fit
Migration path
composer require overtrue/laravel-like:^6.0, confirm the migration has already run (no schema change expected), run like/unlike regression tests, ship.^5.4 and pin explicitly in composer.json, or sequence the Laravel 13 upgrade first. Do not widen the constraint to ^5.4 || ^6.0 unless we are prepared to test both branches.^6.0) rather than *, and commit composer.lock. With this release cadence, floating constraints will break builds annually.Compatibility
orchestra/testbench version alignment in the test suite.Like model, table name override, or config/laravel-like.php customization against the new major.Sequencing
overtrue/laravel-like to ^6.0 as part of that package sweep — not as a standalone PR.Maintenance
composer update side effects.Support
Scaling
withCount), missing composite index on (likeable_type, likeable_id), and no unique constraint to prevent duplicate likes from concurrent requests. Verify the shipped migration covers the index and unique key; if not, add a follow-up migration.Failure modes
Ramp-up
->like(), done. Documentation needs are one internal page.How can I help you explore Laravel packages today?