✨ Key Features
Everything you need to add social interaction features to your Laravel app.
Easy to Use
Install via Composer, add the trait and start liking — automatic service provider registration, minimal setup.
Multiple Interaction Types
Like, dislike and love out of the box, or extend to your own interaction types with the config.
Polymorphic & Eloquent-native
Works with any Eloquent model through polymorphic relationships — no schema coupling.
Idempotent by Design
Single-active invariant per user per model, enforced transactionally. Calling like() twice never duplicates.
Strict Counting
Single COUNT / EXISTS queries, batch APIs for whole collections, and optional config-driven caching.
UUID Support
Switch to UUID primary keys with a single config flag — perfect for distributed and sync-heavy apps.
Get Started in Four Steps
From composer require to your first like — everything you need is below.
Install via Composer
composer require cslant/laravel-likePublish config & migrate
php artisan vendor:publish --provider="CSlant\LaravelLike\Providers\LikeServiceProvider"
php artisan migrateAdd the trait
Start interacting
Frequently Asked Questions
Quick answers to the questions Laravel developers ask most.
Which PHP and Laravel versions are supported?
Is the vendor:publish step required?
Can a user like the same model twice?
Which models can interact?
Add social interactions to your Laravel app
Like, dislike and love with one package — idempotent, strict and Laravel-native.
