PHPackages                             nanosolutions/laravel-likeable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. nanosolutions/laravel-likeable

ActiveLibrary[Database &amp; ORM](/categories/database)

nanosolutions/laravel-likeable
==============================

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

1.3.1(10y ago)34581[1 issues](https://github.com/nanosolutions/laravel-likeable/issues)MITPHPPHP &gt;=5.5.0

Since Sep 19Pushed 9y ago2 watchersCompare

[ Source](https://github.com/nanosolutions/laravel-likeable)[ Packagist](https://packagist.org/packages/nanosolutions/laravel-likeable)[ RSS](/packages/nanosolutions-laravel-likeable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (19)Used By (0)

Laravel Likeable Plugin
=======================

[](#laravel-likeable-plugin)

This is a fork from [rtconner/laravel-likeable](https://github.com/rtconner/laravel-likeable) by Robert Conner - [smartersoftware.net](http://smartersoftware.net) , thank you for smart software :)

We have added option to have dislike as separate field (counter) or any other countable social reaction (follow,hate,dislike,like ..)

TODO:
=====

[](#todo)

Inspired by other [laravel-likeable](https://github.com/DraperStudio/Laravel-Likeable) packages, will add options to tracks reaction with timestamp, which gives us more deep metrics etc..

[![Build Status](https://camo.githubusercontent.com/947772fde4fa9624f351e87aa30d5a2e5ab6715ad364e048a26616e1dbccfea2/68747470733a2f2f7472617669732d63692e6f72672f6e616e6f736f6c7574696f6e732f6c61726176656c2d6c696b6561626c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nanosolutions/laravel-likeable)[![Latest Stable Version](https://camo.githubusercontent.com/b9059cd70ff691fcb64071c84a6a5282bca2ae0470147a68a8e2dbe3ca27814b/68747470733a2f2f706f7365722e707567782e6f72672f6e616e6f736f6c7574696f6e732f6c61726176656c2d6c696b6561626c652f762f737461626c652e737667)](https://packagist.org/packages/nanosolutions/laravel-likeable)[![License](https://camo.githubusercontent.com/7613ba2ee15c0ff395ba53a9299b6f726a5db2ff6ec2c1978aab06bb796ad95d/68747470733a2f2f706f7365722e707567782e6f72672f6e616e6f736f6c7574696f6e732f6c61726176656c2d6c696b6561626c652f6c6963656e73652e737667)](https://packagist.org/packages/nanosolutions/laravel-likeable)

Trait for Laravel Eloquent models to allow easy implementation of a "like" or "favorite" or "remember" feature.

[Laravel 5 Documentation](https://github.com/nanosolutions/laravel-likeable/tree/laravel-5)
[Laravel 4 Documentation](https://github.com/nanosolutions/laravel-likeable/tree/laravel-4)

#### Composer Install (for Laravel 5+)

[](#composer-install-for-laravel-5)

```
composer require nanosolutions/laravel-likeable "~1.3"

```

#### Install and then run the migrations

[](#install-and-then-run-the-migrations)

```
'providers' => [
	\Nano\Likeable\LikeableServiceProvider::class,
],
```

```
php artisan vendor:publish --provider="Nano\Likeable\LikeableServiceProvider" --tag=migrations
php artisan migrate
```

#### Setup your models

[](#setup-your-models)

```
use Nano\Likeable\Likeable;

class Article extends Model {
	use Likeable;
}
```

#### Sample Usage

[](#sample-usage)

```
$article->like(); // like the article for current user
$article->like($myUserId); // pass in your own user id
$article->like(0); // just add likes to the count, and don't track by user

$article->unlike(); // remove like from the article
$article->unlike($myUserId); // pass in your own user id
$article->unlike(0); // remove likes from the count -- does not check for user

// Dislike (new metric)
$article->like('dislike'); // alias -> $article->dislike();
$article->unlike('dislike'); // alias -> $article->dislike($myUserId);

// Or anything you want (no alias)
$article->like('follow');
$article->unlike('follow');

$article->likeCount; // get count of likes
$article->dislikeCount; // get count of dislikes

$article->likes; // Iterable Illuminate\Database\Eloquent\Collection of existing likes
$article->dislikes; // Iterable Illuminate\Database\Eloquent\Collection of existing disklikes
$article->liked(); // check if currently logged in user liked the article
$article->disliked(); // check if currently logged in user disliked the article
$article->liked($myUserId);

Article::whereLiked($myUserId) // find only articles where user liked them
	->with('likeCounter') // highly suggested to allow eager load
	->get();
```

#### Credits

[](#credits)

- Robert Conner -

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 74.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~40 days

Recently: every ~28 days

Total

16

Last Release

3650d ago

Major Versions

0.1.2 → 1.0.02015-02-15

0.2.0 → 1.0.12015-02-16

PHP version history (2 changes)0.1.0PHP &gt;=5.3.0

1.2.0PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/248fd04bb2480de443bedf28bd6644535ab22d1f6dce1ed8aaaecb77c35724f3?d=identicon)[nano](/maintainers/nano)

---

Top Contributors

[![rtconner](https://avatars.githubusercontent.com/u/334533?v=4)](https://github.com/rtconner "rtconner (43 commits)")[![cerw](https://avatars.githubusercontent.com/u/16146?v=4)](https://github.com/cerw "cerw (12 commits)")[![RomainSauvaire](https://avatars.githubusercontent.com/u/1195119?v=4)](https://github.com/RomainSauvaire "RomainSauvaire (2 commits)")[![liorocks](https://avatars.githubusercontent.com/u/534610?v=4)](https://github.com/liorocks "liorocks (1 commits)")

---

Tags

laraveleloquenttraitlaravel5likerememberFollowfavoritelikeablelikablefavourite

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nanosolutions-laravel-likeable/health.svg)

```
[![Health](https://phpackages.com/badges/nanosolutions-laravel-likeable/health.svg)](https://phpackages.com/packages/nanosolutions-laravel-likeable)
```

###  Alternatives

[rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

394388.0k5](/packages/rtconner-laravel-likeable)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[watson/rememberable

Query caching for Laravel

1.1k5.2M13](/packages/watson-rememberable)[cybercog/laravel-ban

Laravel Ban simplify blocking and banning Eloquent models.

1.1k651.8k11](/packages/cybercog-laravel-ban)[qirolab/laravel-reactions

Implement reactions (like, dislike, love, emotion etc) on Laravel Eloquent models.

19564.6k](/packages/qirolab-laravel-reactions)[cybercog/laravel-ownership

Laravel Ownership simplify management of Eloquent model's owner.

9126.6k3](/packages/cybercog-laravel-ownership)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
