PHPackages                             gregoryduckworth/friendable - 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. gregoryduckworth/friendable

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

gregoryduckworth/friendable
===========================

Add the possibility of friends quickly with the use of this trait.

0.2(10y ago)220MITPHPPHP &gt;=5.3.0

Since Aug 21Pushed 10y agoCompare

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

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

Friendable
==========

[](#friendable)

[![Latest Stable Version](https://camo.githubusercontent.com/c39816dedf01ade5c339646fadfdcfa43bd06236513ceb8ae55f37695fcaf640/68747470733a2f2f706f7365722e707567782e6f72672f677265676f72796475636b776f7274682f667269656e6461626c652f762f737461626c65)](https://packagist.org/packages/gregoryduckworth/friendable) [![Total Downloads](https://camo.githubusercontent.com/484fcc6dd91ebe038eb1fcd88c0d929b4a7f4e43d25d7f8159a2f8163486d0eb/68747470733a2f2f706f7365722e707567782e6f72672f677265676f72796475636b776f7274682f667269656e6461626c652f646f776e6c6f616473)](https://packagist.org/packages/gregoryduckworth/friendable) [![Build Status](https://camo.githubusercontent.com/e471d85331decd85ec43fa2599913293f895590ce506978795e4444d409104f9/68747470733a2f2f6170692e7472617669732d63692e6f72672f677265676f72796475636b776f7274682f667269656e6461626c652e706e673f6272616e63683d6d6173746572)](https://api.travis-ci.org/gregoryduckworth/friendable) [![License](https://camo.githubusercontent.com/d1bdba1d5b44ddd8f66114e090486712975b8f61fb08372143fb8e7b9384e02c/68747470733a2f2f706f7365722e707567782e6f72672f677265676f72796475636b776f7274682f667269656e6461626c652f6c6963656e7365)](https://packagist.org/packages/gregoryduckworth/friendable)

Add the possibility of friends quickly with the use of this trait.

Install
-------

[](#install)

Via Composer

```
$ composer require gregoryduckworth/friendable
```

And then include the service providero within `config/app.php`

```
'providers' => [
    ...
    GregoryDuckworth\Friendable\FriendableServiceProvider::class,
    ...
];
```

At lastly you need to publish and run the migration.

```
php artisan vendor:publish && php artisan migrate

```

Usage
-----

[](#usage)

```
Add the Trait to the User Model

use GregoryDuckworth\Friendable\Traits\Friendable;

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

Examples
--------

[](#examples)

#### List all the users confirmed friends

[](#list-all-the-users-confirmed-friends)

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

#### List all the users pending friends

[](#list-all-the-users-pending-friends)

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

#### List all the friends waiting to approve the user

[](#list-all-the-friends-waiting-to-approve-the-user)

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

#### Request the friendship of another user

[](#request-the-friendship-of-another-user)

```
    $user->requestFriendship(Model $friend);
```

#### Confirm the friendship

[](#confirm-the-friendship)

```
    $user->confirmFriendship(Model $friend);
```

#### Remove the friendship

[](#remove-the-friendship)

```
    $user->removeFriendship(Model $friend);
```

Todo
----

[](#todo)

- Add tests (inc travis builds)
- Ability to block friends

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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 ~24 days

Total

2

Last Release

3899d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3cab14bc2b88feb8bd98f56637a91c50e2ba47a81489703f457a8bcb4729b743?d=identicon)[gregoryduckworth](/maintainers/gregoryduckworth)

---

Top Contributors

[![gregoryduckworth](https://avatars.githubusercontent.com/u/2647926?v=4)](https://github.com/gregoryduckworth "gregoryduckworth (3 commits)")

---

Tags

laravelfriendsfriendable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gregoryduckworth-friendable/health.svg)

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

###  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)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[xefi/faker-php-laravel

Faker php integration with laravel

1915.1k](/packages/xefi-faker-php-laravel)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

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