This package is abandoned and no longer maintained. No replacement package was suggested.

Friendable Polymorphic Eloquent Models for Laravel 5

3.2.0 2019-08-28 13:03 UTC

This package is auto-updated.

Last update: 2020-01-28 14:22:37 UTC


Build Status PHP from Packagist Latest Version License


Require this package, with Composer, in the root directory of your project.

$ composer require artisanry/friendable

To get started, you'll need to publish the vendor assets and migrate:

php artisan vendor:publish --provider="Artisanry\Friendable\FriendableServiceProvider" && php artisan migrate


Setup a Model


namespace App;

use Artisanry\Friendable\HasFriends;
use Illuminate\Database\Eloquent\Model;

class User extends Model
    use HasFriends;


Send a Friend-Request to a Model


Unfriend a Model


Deny a Friend-Request from a Model


Accept a Friend-Request from a Model


Block a Model


Unblock a Model


Check if the Model has blocked another Model


Check if one Model is blocked by another Model


Check if a Friendship exists between two models


Get a single friendship


Get a list of all Friendships


Get a list of pending Friendships


Get a list of accepted Friendships


Get a list of denied Friendships


Get a list of blocked Friendships


Get a list of pending Friend-Requests



$ phpunit


If you discover a security vulnerability within this package, please send an e-mail to All security vulnerabilities will be promptly addressed.


This project exists thanks to all the people who contribute.


Mozilla Public License Version 2.0 (MPL-2.0).