PHPackages                             namest/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. namest/likeable

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

namest/likeable
===============

v0.1.2(11y ago)114MITPHP

Since Mar 1Pushed 11y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

Getting Started
===============

[](#getting-started)

Provide an *elegant way* to interact with like feature between your eloquent models.

**Note**: Package only support Laravel 5

Installation
============

[](#installation)

**Step 1**: Install package

```
composer require namest/likeable
```

**Step 2**: Register service provider in your `config/app.php`

```
return [
    ...
    'providers' => [
        ...
        'Namest\Likeable\LikeableServiceProvider',
    ],
    ...
];
```

**Step 3**: Publish package resources, include: configs, migrations. Open your terminal and type:

```
php artisan vendor:publish --provider="Namest\Likeable\LikeableServiceProvider"
```

**Step 4**: Migrate the migration that have been published

```
php artisan migrate
```

**Step 5**: Use some traits to make awesome things

```
class User extends Model
{
    use \Namest\Likeable\LikerTrait;

    // ...
}

class Post extends Model
{
    use \Namest\Likeable\LikeableTrait;

    // ...
}
```

**Step 6**: Read API below and start *happy*

API
===

[](#api)

```
$user = \App\User::find(1);
$post = \App\Post::find(2);

$like = $user->like($post); // Return Namest\Likeable\Like instance
$result = $user->unlike($post); // Return true when success and false on otherwise
```

```
$user = $like->liker; // Return model that like another model
$post = $like->likeable; // Return model that was liked by another model
```

```
$posts = $user->likes; // Return likeable collection that liker was liked
$users = $post->likers; // Return liker collection who like that post
```

```
$users = User::wasLike($post)->...->get(); // Return liker collection who like that post
$posts = Post::likedBy($user)->...->get(); // Return post collection which was liked by the user
```

Events
======

[](#events)

#### namest.likeable.liking

[](#namestlikeableliking)

When: Before `$liker` like a likeable

Payloads:

- `$liker`: Who do this action
- `$likeable`: Which will be liked

Usage:

```
\Event::listen('namest.likeable.liking', function ($liker, $likeable) {
    // Do something
});
```

#### namest.likeable.liked

[](#namestlikeableliked)

When: After `$liker` was like a likeable

Payloads:

- `$liker`: Who do this action
- `$likeable`: Which was liked
- `$like`: Like instance

Usage:

```
\Event::listen('namest.likeable.liked', function ($liker, $likeable, $like) {
    // Do something
});
```

#### namest.likeable.unliking

[](#namestlikeableunliking)

When: Before `$liker` unlike a likeable

Payloads:

- `$liker`: Who do this action
- `$likeable`: Which will be unliked

Usage:

```
\Event::listen('namest.likeable.unliking', function ($liker, $likeable) {
    // Do something
});
```

#### namest.likeable.unliked

[](#namestlikeableunliked)

When: After `$liker` was unlike a likeable

Payloads:

- `$liker`: Who do this action
- `$likeable`: Which was unliked

Usage:

```
\Event::listen('namest.likeable.unliked', function ($liker, $likeable) {
    // Do something
});
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

4096d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b120d989836a5c37a0f9a2558a237d7c14325aa76ba60a24badc402296c220b?d=identicon)[luuhoangnam](/maintainers/luuhoangnam)

---

Top Contributors

[![luuhoangnam](https://avatars.githubusercontent.com/u/5616199?v=4)](https://github.com/luuhoangnam "luuhoangnam (37 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[kirschbaum-development/commentions

A package to allow you to create comments, tag users and more

12369.2k](/packages/kirschbaum-development-commentions)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[glhd/special

1929.4k](/packages/glhd-special)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)

PHPackages © 2026

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