PHPackages                             laravel-interaction/follow - 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. laravel-interaction/follow

ActiveLibrary

laravel-interaction/follow
==========================

User follow/unfollow behaviour for Laravel.

3.5.0(1mo ago)19MITPHPPHP ^8.0

Since Apr 30Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/laravel-interaction/follow)[ Packagist](https://packagist.org/packages/laravel-interaction/follow)[ Docs](https://github.com/laravel-interaction/follow)[ RSS](/packages/laravel-interaction-follow/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (12)Versions (27)Used By (0)

Laravel Follow
==============

[](#laravel-follow)

User follow/unfollow behaviour for Laravel.

[![Latest Stable Version](https://camo.githubusercontent.com/1c4b852951742b1645de35df472ee912dafd6baef708bdec1f1c096c354ab4d0/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d696e746572616374696f6e2f666f6c6c6f772f762f737461626c652e737667)](https://packagist.org/packages/laravel-interaction/follow)[![Total Downloads](https://camo.githubusercontent.com/b01d9db1118e55e4ee307a8943aa431ae6078ed9419ecb73d000952ec00f2a8e/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d696e746572616374696f6e2f666f6c6c6f772f646f776e6c6f616473)](https://packagist.org/packages/laravel-interaction/follow)[![Latest Unstable Version](https://camo.githubusercontent.com/68f7507a0967b9250a0415cbc3b3c779d778effecbbaa810bbb978b7f32d8fc5/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d696e746572616374696f6e2f666f6c6c6f772f762f756e737461626c652e737667)](https://packagist.org/packages/laravel-interaction/follow)[![License](https://camo.githubusercontent.com/d64b0875d6fbd1f5196c321c4b12df568eb7f7c618e2111c38f080b3cbb9a201/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d696e746572616374696f6e2f666f6c6c6f772f6c6963656e7365)](https://packagist.org/packages/laravel-interaction/follow)

Introduction
------------

[](#introduction)

It let people express how they feel about the model(documentation/subject/topic).

[![](https://camo.githubusercontent.com/427dfd50a6f56a30ae79df585c9d90524e20939decf7241c1248d2dc0fef29a4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f466f6c6c6f772d312e326b2d627269676874677265656e3f7374796c653d736f6369616c)](https://camo.githubusercontent.com/427dfd50a6f56a30ae79df585c9d90524e20939decf7241c1248d2dc0fef29a4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f466f6c6c6f772d312e326b2d627269676874677265656e3f7374796c653d736f6369616c)

Installation
------------

[](#installation)

### Requirements

[](#requirements)

- [PHP 8.0+](https://php.net/releases/)
- [Composer](https://getcomposer.org)
- [Laravel 8.0+](https://laravel.com/docs/releases)

### Instructions

[](#instructions)

Require Laravel Follow using [Composer](https://getcomposer.org).

```
composer require laravel-interaction/follow
```

Publish configuration and migrations

```
php artisan vendor:publish --tag=follow-config
php artisan vendor:publish --tag=follow-migrations
```

Run database migrations.

```
php artisan migrate
```

Usage
-----

[](#usage)

### Setup Follower

[](#setup-follower)

```
use Illuminate\Database\Eloquent\Model;
use LaravelInteraction\Follow\Concerns\Follower;

class User extends Model
{
    use Follower;
}
```

### Setup Followable

[](#setup-followable)

```
use Illuminate\Database\Eloquent\Model;
use LaravelInteraction\Follow\Concerns\Followable;

class Channel extends Model
{
    use Followable;
}
```

### Follower

[](#follower)

```
use LaravelInteraction\Follow\Tests\Models\Channel;
/** @var \LaravelInteraction\Follow\Tests\Models\User $user */
/** @var \LaravelInteraction\Follow\Tests\Models\Channel $channel */
// Follow to Followable
$user->follow($channel);
$user->unfollow($channel);
$user->toggleFollow($channel);

// Compare Followable
$user->hasFollowed($channel);
$user->hasNotFollowed($channel);

// Get followed info
$user->followerFollowings()->count();

// with type
$user->followerFollowings()->withType(Channel::class)->count();

// get followed channels
Channel::query()->whereFollowedBy($user)->get();

// get followed channels doesnt followed
Channel::query()->whereNotFollowedBy($user)->get();
```

### Followable

[](#followable)

```
use LaravelInteraction\Follow\Tests\Models\User;
use LaravelInteraction\Follow\Tests\Models\Channel;
/** @var \LaravelInteraction\Follow\Tests\Models\User $user */
/** @var \LaravelInteraction\Follow\Tests\Models\Channel $channel */
// Compare Follower
$channel->isFollowedBy($user);
$channel->isNotFollowedBy($user);
// Get followers info
$channel->followers->each(function (User $user){
    echo $user->getKey();
});

$channels = Channel::query()->withCount('followers')->get();
$channels->each(function (Channel $channel){
    echo $channel->followers()->count(); // 1100
    echo $channel->followers_count; // "1100"
    echo $channel->followersCount(); // 1100
    echo $channel->followersCountForHumans(); // "1.1K"
});
```

### Events

[](#events)

EventFired`LaravelInteraction\Follow\Events\Followed`When an object get followed.`LaravelInteraction\Follow\Events\Unfollowed`When an object get unfollowed.License
-------

[](#license)

Laravel Follow is an open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance85

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 93.2% 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 ~71 days

Recently: every ~274 days

Total

26

Last Release

55d ago

Major Versions

0.6.0 → 1.0.0-alpha.12021-08-28

0.6.1 → 1.0.0-alpha.22021-08-31

1.x-dev → 2.0.0-beta.12022-03-10

2.x-dev → 3.0.02022-11-27

PHP version history (3 changes)0.4.0PHP ^7.2 || ^8.0

2.0.0-beta.1PHP ^7.3 || ^8.0

3.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fafa5bffa28dcd722432b244bf3f0bfe773406df29fea295847e2397b95d50b?d=identicon)[zingimmick](/maintainers/zingimmick)

---

Top Contributors

[![zingimmick](https://avatars.githubusercontent.com/u/26657141?v=4)](https://github.com/zingimmick "zingimmick (41 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

followfollowinglaravellaravelFollowfollowing

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laravel-interaction-follow/health.svg)

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

###  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)[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)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[laravel-interaction/bookmark

User bookmark/unbookmark behaviour for Laravel.

105.0k](/packages/laravel-interaction-bookmark)

PHPackages © 2026

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