| Package Data | |
|---|---|
| Maintainer Username: | gregoryduckworth |
| Maintainer Contact: | gregoryduckworth@users.noreply.github.com (Gregory Duckworth) |
| Package Create Date: | 2015-08-21 |
| Package Last Update: | 2015-09-14 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-26 03:10:45 |
| Package Statistics | |
|---|---|
| Total Downloads: | 20 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 2 |
| Total Watchers: | 0 |
| Total Forks: | 0 |
| Total Open Issues: | 0 |
Add the possibility of friends quickly with the use of this trait.
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
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.