Add the possibility of friends quickly with the use of this trait.
gregoryduckworth/friendable is a Laravel package for add the possibility of friends quickly with the use of this trait..
It currently has 2 GitHub stars and 20 downloads on Packagist (latest version 0.2).
Install it with composer require gregoryduckworth/friendable.
Discover more Laravel packages by gregoryduckworth
or browse all Laravel packages to compare alternatives.
Last updated
Add the possibility of friends quickly with the use of this trait.
Via Composer
$ composer require gregoryduckworth/friendable
The service provider will be automatically registered via Laravel's package auto-discovery.
Publish and run the migration:
php artisan vendor:publish --provider="GregoryDuckworth\Friendable\FriendableServiceProvider" --tag="migrations"
php artisan migrate
Add the Trait to the User Model
use GregoryDuckworth\Friendable\Traits\Friendable;
class User extends Model
{
use Friendable;
...
}
$user->confirmedFriends();
$user->pendingFriends();
$user->awaitingApproval();
$user->requestFriendship(Model $friend);
$user->confirmFriendship(Model $friend);
$user->removeFriendship(Model $friend);
Please see CHANGELOG for more information what has changed recently.
The MIT License (MIT). Please see License File for more information.