gregoryduckworth/friendable
最新稳定版本:0.2
Composer 安装命令:
composer require gregoryduckworth/friendable
包简介
Add the possibility of friends quickly with the use of this trait.
README 文档
README
Add the possibility of friends quickly with the use of this trait.
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
Add the Trait to the User Model use GregoryDuckworth\Friendable\Traits\Friendable; class User extends Model { use Friendable; ... }
Examples
List all the users confirmed friends
$user->confirmedFriends();
List all the users pending friends
$user->pendingFriends();
List all the friends waiting to approve the user
$user->awaitingApproval();
Request the friendship of another user
$user->requestFriendship(Model $friend);
Confirm the friendship
$user->confirmFriendship(Model $friend);
Remove the friendship
$user->removeFriendship(Model $friend);
Todo
- Add tests (inc travis builds)
- Ability to block friends
Change log
Please see CHANGELOG for more information what has changed recently.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 20
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-21