Skip to main content
💖 Social Interactions for Laravel

Documentation For Laravel Like Package

The interaction for User 👍 like, 👎 dislike, and love ❤️ features for Laravel Application.

We provide easy to use and can be integrated into any Laravel application. Get started with Laravel Like Package.

LaravelLikeDislikeLoveEloquentPHP
CSlant Laravel Like Package
📄
0
Doc pages
💖
0
Interaction types
💚
0%
Open source
🚀
0
Laravel majors supported

✨ 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.

1

Install via Composer

The package registers its service provider automatically via package auto-discovery.
composer require cslant/laravel-like
2

Publish config & migrate

Publish config/like.php and the likes table migrations, then migrate.
php artisan vendor:publish --provider="CSlant\LaravelLike\Providers\LikeServiceProvider"
php artisan migrate
3

Add the trait

Use the provided trait on your model to enable interactions instantly.
4

Start interacting

Like, dislike or love from anywhere — Like::like($post), isLiked(), toggle() and more.

Frequently Asked Questions

Quick answers to the questions Laravel developers ask most.

Which PHP and Laravel versions are supported?
Laravel Like supports PHP ^8.2 (8.2 – 8.5) and Laravel 11, 12 and 13. Laravel 13 requires PHP 8.3 or newer.
Is the vendor:publish step required?
Yes. It is required — it publishes config/like.php and the migrations for the likes table, including the composite lookup index.
Can a user like the same model twice?
No. The package enforces a single-active invariant per user per model, enforced transactionally — calling like() again is idempotent and never duplicates rows.
Which models can interact?
Any Eloquent model. Interactions use polymorphic relationships, so there is no schema coupling and no N+1 queries.

Add social interactions to your Laravel app

Like, dislike and love with one package — idempotent, strict and Laravel-native.