PHPackages                             gridprinciples/friendly - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. gridprinciples/friendly

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

gridprinciples/friendly
=======================

Friends system for users, on Laravel.

0.1.0(10y ago)105261PHP

Since Aug 25Pushed 10y ago3 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Friendly [![Build Status](https://camo.githubusercontent.com/3bf23c829268692e14c1492d60d6992b92e55c8073574e92de641e174fd0001d/68747470733a2f2f7472617669732d63692e6f72672f677269647072696e6369706c65732f667269656e646c792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/gridprinciples/friendly)
=============================================================================================================================================================================================================================================================================================================

[](#friendly-)

A [Laravel 5.1](http://laravel.com/docs/5.1) package designed to enhance Eloquent users with connections between users, including approvals by both users and additional data.

**Friendly** includes many shortcuts to creating one's own Friend system, but the developer is free to implement the details however they require.

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

[](#installation)

1. Run `composer require gridprinciples/friendly` from your project directory.
2. Add the following to the `providers` array in `config/app.php`:

    ```
    GridPrinciples\Friendly\Providers\FriendlyServiceProvider::class,
    ```
3. Publish the migrations and config file:

    ```
    php artisan vendor:publish --provider="GridPrinciples\Friendly\Providers\FriendlyServiceProvider"

    ```
4. Run the migrations:

    ```
    php artisan migrate

    ```

    This will add a `friends` table to your database to track relationships between models.

Usage
-----

[](#usage)

**Add the `Friendly` trait to your User model:**
`use Friendly;`

You may now relate users to each other:

```
// Using the "requesting" user model...
$dad = User::where('name', 'darth')->first();

// ...and the one receiving the friend request...
$kid = User::where('name', 'luke')->first();

// may include "pivot" data.
$dad->befriend($kid, [
    'name'       => 'Father',
    'other_name' => 'Son',
    'start'      => '1980-05-21',
]);

// ...and later, the secondary user approves the request:
$kid->approve($dad);

// At this point, either user is associated with the other via their `friends` attribute (a Collection):
$relatives = $kid->friends->toArray();

// Either user may sever the relationship, resulting in a type of block:
$kid->block($dad);
```

### Pivot Data

[](#pivot-data)

The included implementation table includes the following additional information about each friend request:

- `name`: Describes the requesting user's relationship with the secondary user.
- `other_name`: Describes the secondary user's relationship with the requesting user.
- `start`: When the relationship started, or will start.
- `end`: When the relationship

### Reloading the Connections

[](#reloading-the-connections)

When time you access the "friends" property on a user Model, the connections will be loaded and cached. If you make changes to a different relationship which would affect a loaded user's friends, you might need to reload them:

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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

3919d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aba1078ca8f1e8c1a3b12e7e6bff28b3beb8a1a69715859cf459ddd7ae73cb44?d=identicon)[gbrock](/maintainers/gbrock)

---

Top Contributors

[![gbrock](https://avatars.githubusercontent.com/u/4151394?v=4)](https://github.com/gbrock "gbrock (13 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gridprinciples-friendly/health.svg)

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

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)

PHPackages © 2026

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