PHPackages                             heiheihallo/acquaintances - 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. heiheihallo/acquaintances

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

heiheihallo/acquaintances
=========================

This is a clone of multicaret/laravel-acquaintances customized to our needs. With added dislike functionality. This light package, with no dependencies, gives Eloquent models the ability to manage friendships (with groups). And interactions such as: Likes, favorites, votes, subscribe, follow, ..etc. And it includes advanced rating system.

v1.1.2(3y ago)02.0k↓50%MITPHPPHP &gt;=7.1

Since Nov 5Pushed 3y agoCompare

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

READMEChangelog (4)Dependencies (6)Versions (5)Used By (0)

HeiHallo Acquaintances
======================

[](#heihallo-acquaintances)

[![Total Downloads](https://camo.githubusercontent.com/90028f15fd22ba1287a80983e3ec8bcc7662774f9f02593158bc294cddd72fa7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68656968656968616c6c6f2f6163717561696e74616e6365732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/heiheihallo/acquaintances)[![Latest Version](https://camo.githubusercontent.com/652e2bd5cda938ebf53191bbca3cde9517c7a9e17bc7ceff2f4c240dd37af33b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f68656968656968616c6c6f2f6163717561696e74616e6365732e7376673f7374796c653d666c61742d737175617265)](https://github.com/heiheihallo/acquaintances/releases)[![License](https://camo.githubusercontent.com/06589aecb16a50b360210fc7b1f51c19a5c5f0aa483ec3205e614bf47cef1e93/68747470733a2f2f706f7365722e707567782e6f72672f68656968656968616c6c6f2f6163717561696e74616e6365732f6c6963656e73652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/heiheihallo/acquaintances)

[Forked from https://github.com/multicaret/laravel-acquaintances](https://github.com/multicaret/laravel-acquaintances)Added dislike functionality and CanBe/CanDo traits

[![](https://camo.githubusercontent.com/b9f0cead8344eb378f5632cca7f57338841b1c6650b3140a1cc4670df9fa5c78/68747470733a2f2f68656968616c6c6f2e636f6d2f696d616765732f6c6f676f2f68656968616c6c6f2d677265656e2e7376673f757064617465643d33)](https://camo.githubusercontent.com/b9f0cead8344eb378f5632cca7f57338841b1c6650b3140a1cc4670df9fa5c78/68747470733a2f2f68656968616c6c6f2e636f6d2f696d616765732f6c6f676f2f68656968616c6c6f2d677265656e2e7376673f757064617465643d33)

Supports Laravel 9 and below, with no dependencies

TL;DR
-----

[](#tldr)

Gives eloquent models:

- Friendships &amp; Groups ability
- Interactions ability such as:
    - Likes
    - Dislikes (custom)
    - Favorites
    - Votes (up/down)
    - Subscribe
    - Follow
    - Ratings
    - Views

Take this example:

```
$user1 = User::find(1);
$user2 = User::find(2);

$user1->befriend($user2);
$user2->acceptFriendRequest($user1);

// The messy breakup :(
$user2->unfriend($user1);
```

1. [Introduction](#introduction)
2. [Installation](#installation)
3. [Friendships:](#friendships)
    - [Friend Requests](#friend-requests)
    - [Check Friend Requests](#check-friend-requests)
    - [Retrieve Friend Requests](#retrieve-friend-requests)
    - [Retrieve Friends](#retrieve-friends)
    - [Friend Groups](#friend-groups)
4. [Interactions](#interactions)
    - [Traits Usage](#traits-usage)
    - [Follow](#follow)
    - [Rate](#rate)
    - [Like](#like)
    - [Dislike](#dislike)
    - [Favorite](#favorite)
    - [Subscribe](#subscribe)
    - [Vote](#vote)
    - [View](#view)
    - [Parameters](#parameters)
    - [Query relations](#query-relations)
    - [Working with model](#working-with-model)
5. [Events](#events)
6. [Contributing](#contributing)

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

[](#introduction)

This light package gives Eloquent models the ability to manage their acquaintances and other cool useful stuff. You can easily design your social-like System (Facebook, Twitter, Foursquare...etc).

##### Acquaintances includes:

[](#acquaintances-includes)

- Send Friend Requests
- Accept Friend Requests
- Deny Friend Requests
- Block a User
- Group Friends
- Rate a User or a Model, supporting multiple aspects
- Follow a User or a Model
- Like a User or a Model
- Dislike a User or a Model
- Subscribe a User or a Model
- Favorite a User or a Model
- Vote (Upvote &amp; Downvote a User or a Model)
- View a User or a Model

---

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

[](#installation)

First, install the package through Composer.

```
composer require heiheihallo/acquaintances
```

Laravel 5.8 and up =&gt; version 2.x (branch master)

Laravel 5.7 and below =&gt; version 1.x (branch v1)

Publish config and migrations:

```
php artisan vendor:publish --provider="HeiHeiHallo\Acquaintances\AcquaintancesServiceProvider"
```

Configure the published config in:

```
config/acquaintances.php

```

Finally, migrate the database to create the table:

```
php artisan migrate
```

---

Setup a Model
-------------

[](#setup-a-model)

Example:

```
use HeiHeiHallo\Acquaintances\Traits\Friendable;
use HeiHeiHallo\Acquaintances\Traits\CanFollow;
use HeiHeiHallo\Acquaintances\Traits\CanBeFollowed;
use HeiHeiHallo\Acquaintances\Traits\CanLike;
use HeiHeiHallo\Acquaintances\Traits\CanBeLiked;
use HeiHeiHallo\Acquaintances\Traits\CanRate;
use HeiHeiHallo\Acquaintances\Traits\CanBeRated;
//...

class User extends Model
{
    use Friendable;
    use CanFollow, CanBeFollowed;
    use CanLike, CanBeLiked;
    use CanRate, CanBeRated;
    //...
}
```

All available APIs are listed below for Friendships &amp; Interactions.

---

Friendships:
------------

[](#friendships)

### Friend Requests:

[](#friend-requests)

Add `Friendable` Trait to User model.

```
use HeiHeiHallo\Acquaintances\Traits\Friendable;

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

#### Send a Friend Request

[](#send-a-friend-request)

```
$user->befriend($recipient);
```

#### Accept a Friend Request

[](#accept-a-friend-request)

```
$user->acceptFriendRequest($sender);
```

#### Deny a Friend Request

[](#deny-a-friend-request)

```
$user->denyFriendRequest($sender);
```

#### Remove Friend

[](#remove-friend)

```
$user->unfriend($friend);
```

#### Block a Model

[](#block-a-model)

```
$user->blockFriend($friend);
```

#### Unblock a Model

[](#unblock-a-model)

```
$user->unblockFriend($friend);
```

#### Check if Model is Friend with another Model

[](#check-if-model-is-friend-with-another-model)

```
$user->isFriendWith($friend);
```

### Check Friend Requests:

[](#check-friend-requests)

#### Check if Model has a pending friend request from another Model

[](#check-if-model-has-a-pending-friend-request-from-another-model)

```
$user->hasFriendRequestFrom($sender);
```

#### Check if Model has already sent a friend request to another Model

[](#check-if-model-has-already-sent-a-friend-request-to-another-model)

```
$user->hasSentFriendRequestTo($recipient);
```

#### Check if Model has blocked another Model

[](#check-if-model-has-blocked-another-model)

```
$user->hasBlocked($friend);
```

#### Check if Model is blocked by another Model

[](#check-if-model-is-blocked-by-another-model)

```
$user->isBlockedBy($friend);
```

---

### Retrieve Friend Requests:

[](#retrieve-friend-requests)

#### Get a single friendship

[](#get-a-single-friendship)

```
$user->getFriendship($friend);
```

#### Get a list of all Friendships

[](#get-a-list-of-all-friendships)

```
$user->getAllFriendships();
$user->getAllFriendships($group_name, $perPage = 20, $fields = ['id','name']);
```

#### Get a list of pending Friendships

[](#get-a-list-of-pending-friendships)

```
$user->getPendingFriendships();
$user->getPendingFriendships($group_name, $perPage = 20, $fields = ['id','name']);
```

#### Get a list of accepted Friendships

[](#get-a-list-of-accepted-friendships)

```
$user->getAcceptedFriendships();
$user->getAcceptedFriendships($group_name, $perPage = 20, $fields = ['id','name']);
```

#### Get a list of denied Friendships

[](#get-a-list-of-denied-friendships)

```
$user->getDeniedFriendships();
$user->getDeniedFriendships($perPage = 20, $fields = ['id','name']);
```

#### Get a list of blocked Friendships

[](#get-a-list-of-blocked-friendships)

```
$user->getBlockedFriendships();
$user->getBlockedFriendships($perPage = 20, $fields = ['id','name']);
```

#### Get a list of pending Friend Requests

[](#get-a-list-of-pending-friend-requests)

```
$user->getFriendRequests();
```

#### Get the number of Friends

[](#get-the-number-of-friends)

```
$user->getFriendsCount();
```

#### Get the number of Pending Requests

[](#get-the-number-of-pending-requests)

```
$user->getPendingsCount();
```

#### Get the number of mutual Friends with another user

[](#get-the-number-of-mutual-friends-with-another-user)

```
$user->getMutualFriendsCount($otherUser);
```

Retrieve Friends:
-----------------

[](#retrieve-friends)

To get a collection of friend models (ex. User) use the following methods:

#### `getFriends()`

[](#getfriends)

```
$user->getFriends();
// or paginated
$user->getFriends($perPage = 20, $group_name);
// or paginated with certain fields
$user->getFriends($perPage = 20, $group_name, $fields = ['id','name']);
// or paginated with cursor & certain fields
$user->getFriends($perPage = 20, $group_name, $fields = ['id','name'], $cursor = true);
```

Parameters:

- `$perPage`: integer (default: `0`), Get values paginated
- `$group_name`: string (default: `''`), Get collection of Friends in specific group paginated
- `$fields`: array (default: `['*']`), Specify the desired fields to query.

#### `getFriendsOfFriends()`

[](#getfriendsoffriends)

```
$user->getFriendsOfFriends();
// or
$user->getFriendsOfFriends($perPage = 20);
// or
$user->getFriendsOfFriends($perPage = 20, $fields = ['id','name']);
```

Parameters:

- `$perPage`: integer (default: `0`), Get values paginated
- `$fields`: array (default: `['*']`), Specify the desired fields to query.

#### `getMutualFriends()`

[](#getmutualfriends)

Get mutual Friends with another user

```
$user->getMutualFriends($otherUser);
// or
$user->getMutualFriends($otherUser, $perPage = 20);
// or
$user->getMutualFriends($otherUser, $perPage = 20, $fields = ['id','name']);
```

Parameters:

- `$other`: Model (required), The Other user model to check mutual friends with
- `$perPage`: integer (default: `0`), Get values paginated
- `$fields`: array (default: `['*']`), Specify the desired fields to query.

Friend Groups:
--------------

[](#friend-groups)

The friend groups are defined in the `config/acquaintances.php` file. The package comes with a few default groups. To modify them, or add your own, you need to specify a `slug` and a `key`.

```
// config/acquaintances.php
//...
'groups' => [
    'acquaintances' => 0,
    'close_friends' => 1,
    'family' => 2
];
```

Since you've configured friend groups, you can group/ungroup friends using the following methods.

#### Group a Friend

[](#group-a-friend)

```
$user->groupFriend($friend, $group_name);
```

#### Remove a Friend from family group

[](#remove-a-friend-from-family-group)

```
$user->ungroupFriend($friend, 'family');
```

#### Remove a Friend from all groups

[](#remove-a-friend-from-all-groups)

```
$user->ungroupFriend($friend);
```

#### Get the number of Friends in specific group

[](#get-the-number-of-friends-in-specific-group)

```
$user->getFriendsCount($group_name);
```

#### To filter `friendships` by group you can pass a group slug.

[](#to-filter-friendships-by-group-you-can-pass-a-group-slug)

```
$user->getAllFriendships($group_name);
$user->getAcceptedFriendships($group_name);
$user->getPendingFriendships($group_name);
...
```

Interactions
------------

[](#interactions)

### Traits Usage:

[](#traits-usage)

Add `CanXXX` Traits to User model.

```
use HeiHeiHallo\Acquaintances\Traits\CanFollow;
use HeiHeiHallo\Acquaintances\Traits\CanLike;
use HeiHeiHallo\Acquaintances\Traits\CanFavorite;
use HeiHeiHallo\Acquaintances\Traits\CanSubscribe;
use HeiHeiHallo\Acquaintances\Traits\CanVote;

class User extends Model
{
    use CanFollow, CanLike, CanFavorite, CanSubscribe, CanVote;
}
```

Add `CanBeXXX` Trait to target model, such as 'Post' or 'Book' ...:

```
use HeiHeiHallo\Acquaintances\Traits\CanBeLiked;
use HeiHeiHallo\Acquaintances\Traits\CanBeFavorited;
use HeiHeiHallo\Acquaintances\Traits\CanBeVoted;
use HeiHeiHallo\Acquaintances\Traits\CanBeRated;

class Post extends Model
{
    use CanBeLiked, CanBeFavorited, CanBeVoted, CanBeRated;
}
```

All available APIs are listed below.

### Follow

[](#follow)

#### `\HeiHeiHallo\Acquaintances\Traits\CanFollow`

[](#heiheihalloacquaintancestraitscanfollow)

```
$user->follow($targets);
$user->unfollow($targets);
$user->toggleFollow($targets);
$user->followings()->get(); // App\User:class
$user->followings(App\Post::class)->get();
$user->isFollowing($target);
```

#### `\HeiHeiHallo\Acquaintances\Traits\CanBeFollowed`

[](#heiheihalloacquaintancestraitscanbefollowed)

```
$object->followers()->get();
$object->isFollowedBy($user);
$object->followersCount(); // or as attribute $object->followers_count
$object->followersCountReadable(); // return readable number with precision, i.e: 5.2K
```

### Rate

[](#rate)

#### `\HeiHeiHallo\Acquaintances\Traits\CanRate`

[](#heiheihalloacquaintancestraitscanrate)

```
// Rate type in the following line will be
// the same as the one specified
// in config('acquaintances.rating.defaults.type')
// if your app is using a single type of rating on your model,
// like one factor only, then simply use the rate() as it's shown here,
// and if you have multiple factors then
// take a look the examples exactly below this these ones.
$user->rate($targets);
$user->unrate($targets);
$user->toggleRate($targets);
$user->ratings()->get(); // App\User:class
$user->ratings(App\Post::class)->get();
$user->hasRated($target);

// Some Examples on how to rate the object based on different factors (rating type)
$user->setRateType('bedside-manners')->rate($target, 4);
$user->setRateType('waiting-time')->rate($target, 3);
$user->setRateType('quality')->rate($target, 4);
$user->setRateType('delivery-time')->rate($target, 2);
$user->setRateType('communication')->rate($target, 5);
// Remember that you can always use the functions on $target which have this phrase "AllTypes" in them. check the below section for more details
```

#### `\HeiHeiHallo\Acquaintances\Traits\CanBeRated`

[](#heiheihalloacquaintancestraitscanberated)

```
$object->raters()->get();
$object->isRatedBy($user);

$object->averageRating(); // or as attribute $object->average_rating
$object->averageRatingAllTypes(); // or as attribute $object->average_rating_all_types

$object->sumRating(); // or as attribute $object->sum_rating
$object->sumRatingAllTypes(); // or as attribute $object->sum_rating_all_types_all_types

$object->sumRatingReadable(); // return readable number with precision, i.e: 5.2K
$object->sumRatingAllTypesReadable(); // return readable number with precision, i.e: 5.2K

$object->ratingPercent($max = 5); // calculating the percentage based on the passed coefficient
$object->ratingPercentAllTypes($max = 5); // calculating the percentage based on the passed coefficient

// User Related:

$object->userAverageRatingAllTypes(); // or as attribute $object->user_average_rating_all_types

$object->userSumRatingAllTypes(); // or as attribute $object->user_sum_rating_all_types

$object->userSumRatingReadable(); // return readable number with precision, i.e: 5.2K
$object->userSumRatingAllTypesReadable(); // return readable number with precision, i.e: 5.2K
```

### Like

[](#like)

#### `\HeiHeiHallo\Acquaintances\Traits\CanLike`

[](#heiheihalloacquaintancestraitscanlike)

```
$user->like($targets);
$user->unlike($targets);
$user->toggleLike($targets);
$user->hasLiked($target);
$user->likes()->get(); // default object: App\User:class
$user->likes(App\Post::class)->get();
```

#### `\HeiHeiHallo\Acquaintances\Traits\CanBeLiked`

[](#heiheihalloacquaintancestraitscanbeliked)

```
$object->likers()->get();
$object->fans()->get(); // or $object->fans. it's an alias of likers()
$object->isLikedBy($user);
$object->likersCount(); // or as attribute $object->likers_count
$object->likersCountReadable(); // return readable number with precision, i.e: 5.2K
```

### Dislike

[](#dislike)

#### `\HeiHeiHallo\Acquaintances\Traits\CanDislike`

[](#heiheihalloacquaintancestraitscandislike)

```
$user->dislike($targets);
$user->undislike($targets);
$user->toggleDislike($targets);
$user->hasDisliked($target);
$user->dislikes()->get(); // default object: App\User:class
$user->dislikes(App\Post::class)->get();
```

#### `\HeiHeiHallo\Acquaintances\Traits\CanBeDisliked`

[](#heiheihalloacquaintancestraitscanbedisliked)

```
$object->dislikers()->get();
$object->haters()->get(); // or $object->haters. it's an alias of dislikers()
$object->isDislikedBy($user);
$object->dislikersCount(); // or as attribute $object->dislikers_count
$object->dislikersCountReadable(); // return readable number with precision, i.e: 5.2K
```

### Favorite

[](#favorite)

#### `\HeiHeiHallo\Acquaintances\Traits\CanFavorite`

[](#heiheihalloacquaintancestraitscanfavorite)

```
$user->favorite($targets);
$user->unfavorite($targets);
$user->toggleFavorite($targets);
$user->hasFavorited($target);
$user->favorites()->get(); // App\User:class
$user->favorites(App\Post::class)->get();
```

#### `\HeiHeiHallo\Acquaintances\Traits\CanBeFavorited`

[](#heiheihalloacquaintancestraitscanbefavorited)

```
$object->favoriters()->get(); // or $object->favoriters
$object->isFavoritedBy($user);
$object->favoritersCount(); // or as attribute $object->favoriters_count
$object->favoritersCountReadable(); // return readable number with precision, i.e: 5.2K
```

### Subscribe

[](#subscribe)

#### `\HeiHeiHallo\Acquaintances\Traits\CanSubscribe`

[](#heiheihalloacquaintancestraitscansubscribe)

```
$user->subscribe($targets);
$user->unsubscribe($targets);
$user->toggleSubscribe($targets);
$user->hasSubscribed($target);
$user->subscriptions()->get(); // default object: App\User:class
$user->subscriptions(App\Post::class)->get();
```

#### `HeiHeiHallo\Acquaintances\Traits\CanBeSubscribed`

[](#heiheihalloacquaintancestraitscanbesubscribed)

```
$object->subscribers(); // or $object->subscribers
$object->isSubscribedBy($user);
$object->subscribersCount(); // or as attribute $object->subscribers_count
$object->subscribersCountReadable(); // return readable number with precision, i.e: 5.2K
```

### Vote

[](#vote)

#### `\HeiHeiHallo\Acquaintances\Traits\CanVote`

[](#heiheihalloacquaintancestraitscanvote)

```
$user->vote($target); // Vote with 'upvote' for default
$user->upvote($target);
$user->downvote($target);
$user->cancelVote($target);
$user->hasUpvoted($target);
$user->hasDownvoted($target);
$user->votes(App\Post::class)->get();
$user->upvotes(App\Post::class)->get();
$user->downvotes(App\Post::class)->get();
```

#### `\HeiHeiHallo\Acquaintances\Traits\CanBeVoted`

[](#heiheihalloacquaintancestraitscanbevoted)

```
$object->voters()->get();
$object->isVotedBy($user);
$object->votersCount(); // or as attribute $object->voters_count
$object->votersCountReadable(); // return readable number with precision, i.e: 5.2K

$object->upvoters()->get();
$object->isUpvotedBy($user);
$object->upvotersCount(); // or as attribute $object->upvoters_count
$object->upvotersCountReadable(); // return readable number with precision, i.e: 5.2K

$object->downvoters()->get();
$object->isDownvotedBy($user);
$object->downvotersCount(); // or as attribute $object->downvoters_count
$object->downvotersCountReadable(); // return readable number with precision, i.e: 5.2K
```

### View

[](#view)

#### `\HeiHeiHallo\Acquaintances\Traits\CanView`

[](#heiheihalloacquaintancestraitscanview)

```
$user->view($targets);
$user->unview($targets);
$user->toggleView($targets);
$user->hasViewed($target);
$user->viewers()->get(); // default object: App\User:class
$user->viewers(App\Post::class)->get();
```

#### `\HeiHeiHallo\Acquaintances\Traits\CanBeViewed`

[](#heiheihalloacquaintancestraitscanbeviewed)

```
$object->viewers()->get();
$object->isViewedBy($user);
$object->viewersCount(); // or as attribute $object->viewers_count
$object->viewersCountReadable(); // return readable number with precision, i.e: 5.2K
```

### Parameters

[](#parameters)

All the above mentioned methods of creating relationships, such as 'follow', 'like', 'unfollow', 'unlike', their syntax is as follows:

```
follow(array|int|\Illuminate\Database\Eloquent\Model $targets, $class = __CLASS__)
```

So you can call them like this:

```
// id / int|array
$user->follow(1); // targets: 1, $class = App\User
$user->follow(1, App\Post::class); // targets: 1, $class = App\Post
$user->follow([1, 2, 3]); // targets: [1, 2, 3], $class = App\User

// Model
$post = App\Post::find(7);
$user->follow($post); // targets: $post->id, $class = App\Post

// Model array
$posts = App\Post::popular()->get();
$user->follow($posts); // targets: [1, 2, ...], $class = App\Post
```

### Query relations

[](#query-relations)

```
$followers = $user->followers;
$followers = $user->followers()->where('id', '>', 10)->get();
$followers = $user->followers()->orderByDesc('id')->get();
$followers = $user->followers()->paginate(10);
```

You may use the others in the same way.

### Working with model

[](#working-with-model)

```
use HeiHeiHallo\Acquaintances\Models\InteractionRelation;

// Get most popular object
// 1- All types
$relations = InteractionRelation::popular()->get();

// 2- subject_type = App\Post
$relations = InteractionRelation::popular(App\Post::class)->get();

// 3- subject_type = App\User
$relations = InteractionRelation::popular('user')->get();

// 4- subject_type = App\Post
$relations = InteractionRelation::popular('post')->get();

// 5- Pagination
$relations = InteractionRelation::popular(App\Post::class)->paginate(15);
```

Events
------

[](#events)

This is the list of the events fired by default for each action:

Event nameFiredacq.friendships.sentWhen a friend request is sentacq.friendships.acceptedWhen a friend request is acceptedacq.friendships.deniedWhen a friend request is deniedacq.friendships.blockedWhen a friend is blockedacq.friendships.unblockedWhen a friend is unblockedacq.friendships.cancelledWhen a friendship is cancelledacq.ratings.rateWhen a an item or items get Ratedacq.ratings.unrateWhen a an item or items get unRatedacq.vote.upWhen a an item or items get upvotedacq.vote.downWhen a an item or items get downvotedacq.vote.cancelWhen a an item or items get vote cancellationacq.likes.likeWhen a an item or items get likedacq.likes.unlikeWhen a an item or items get unlikedacq.dislikes.dislikeWhen a an item or items get dislikedacq.dislikes.undislikeWhen a an item or items get undislikedacq.followships.followWhen a an item or items get followedacq.followships.unfollowWhen a an item or items get unfollowedacq.favorites.favoriteWhen a an item or items get favoredacq.favorites.unfavoriteWhen a an item or items get unfavoredacq.subscriptions.subscribeWhen a an item or items get subscribedacq.subscriptions.unsubscribeWhen a an item or items get unsubscribedacq.views.viewWhen a an item or items get viewedacq.views.unviewWhen a an item or items get unviewed### Contributing

[](#contributing)

See the [CONTRIBUTING](CONTRIBUTING.md) guide.

The initial version of this library was assisted by the following repos [laravel-acquaintances](https://github.com/multicaret/laravel-acquaintances)&amp; [laravel-friendships](https://github.com/hootlex/laravel-friendships)&amp; [laravel-follow](https://github.com/overtrue/laravel-follow).

### Change Log

[](#change-log)

See the [log](CHANGELOG.md) file.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.6% 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 ~38 days

Total

4

Last Release

1174d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/42670337?v=4)[Anders Heim](/maintainers/heiheihallo)[@heiheihallo](https://github.com/heiheihallo)

---

Top Contributors

[![mkwsra](https://avatars.githubusercontent.com/u/1743919?v=4)](https://github.com/mkwsra "mkwsra (98 commits)")[![jaulz](https://avatars.githubusercontent.com/u/5358638?v=4)](https://github.com/jaulz "jaulz (50 commits)")[![heiheihallo](https://avatars.githubusercontent.com/u/42670337?v=4)](https://github.com/heiheihallo "heiheihallo (4 commits)")[![waelkhalifa](https://avatars.githubusercontent.com/u/43730892?v=4)](https://github.com/waelkhalifa "waelkhalifa (3 commits)")[![Necmttn](https://avatars.githubusercontent.com/u/5212808?v=4)](https://github.com/Necmttn "Necmttn (2 commits)")[![GreenImp](https://avatars.githubusercontent.com/u/1846676?v=4)](https://github.com/GreenImp "GreenImp (2 commits)")[![francoism90](https://avatars.githubusercontent.com/u/5028905?v=4)](https://github.com/francoism90 "francoism90 (1 commits)")[![LorenzoSapora](https://avatars.githubusercontent.com/u/25519274?v=4)](https://github.com/LorenzoSapora "LorenzoSapora (1 commits)")[![micos7](https://avatars.githubusercontent.com/u/4460809?v=4)](https://github.com/micos7 "micos7 (1 commits)")[![usernotnull](https://avatars.githubusercontent.com/u/15612814?v=4)](https://github.com/usernotnull "usernotnull (1 commits)")[![agus24](https://avatars.githubusercontent.com/u/23353234?v=4)](https://github.com/agus24 "agus24 (1 commits)")[![wuwx](https://avatars.githubusercontent.com/u/4401?v=4)](https://github.com/wuwx "wuwx (1 commits)")[![amayer5125](https://avatars.githubusercontent.com/u/3212673?v=4)](https://github.com/amayer5125 "amayer5125 (1 commits)")[![ange007](https://avatars.githubusercontent.com/u/2736539?v=4)](https://github.com/ange007 "ange007 (1 commits)")[![brenobarnard](https://avatars.githubusercontent.com/u/42187458?v=4)](https://github.com/brenobarnard "brenobarnard (1 commits)")[![ctf0](https://avatars.githubusercontent.com/u/7388088?v=4)](https://github.com/ctf0 "ctf0 (1 commits)")[![Forsakenrox](https://avatars.githubusercontent.com/u/11795286?v=4)](https://github.com/Forsakenrox "Forsakenrox (1 commits)")

---

Tags

laraveleloquentfriendsRatesocial medialikeRatingdislikefriendshipsFollowersfriend-systeminteractionsfollowshipswish-list

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/heiheihallo-acquaintances/health.svg)

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

###  Alternatives

[multicaret/laravel-acquaintances

This light package, with no dependencies, gives Eloquent models the ability to manage friendships (with groups), verifications, and interactions such as: Likes, favorites, votes, subscribe, follow, ..etc. And it includes advanced rating system.

851266.9k2](/packages/multicaret-laravel-acquaintances)[cybercog/laravel-love

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

1.2k302.7k1](/packages/cybercog-laravel-love)[qirolab/laravel-reactions

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

19564.6k](/packages/qirolab-laravel-reactions)[hootlex/laravel-friendships

This package gives Eloquent models the ability to manage their friendships.

705114.6k](/packages/hootlex-laravel-friendships)[merodiro/friendships

This package gives users the ability to manage their friendships.

459.7k](/packages/merodiro-friendships)[demency/laravel-friendships

This package gives Eloquent models the ability to manage their friendships.

201.0k](/packages/demency-laravel-friendships)

PHPackages © 2026

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