From 5136d532467b3fa32410998411cb3bc8eb457a00 Mon Sep 17 00:00:00 2001 From: rennokki Date: Sat, 25 Aug 2018 22:49:15 +0300 Subject: [PATCH] Using correct interface checks & docs update (Fixes #27) (#28) * Reverted back to Follower. * Fixed documentation on blocking() and liking() --- readme.md | 8 ++++---- src/Traits/CanFollow.php | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/readme.md b/readme.md index 8919edb..6a47f74 100644 --- a/readme.md +++ b/readme.md @@ -160,8 +160,8 @@ $user->block($user); $user->block($page); $user->unblock($user); -$user->blockings(); // Users that this user blocks. -$user->blockings(Page::class); // Pages that this user blocks. +$user->blocking(); // Users that this user blocks. +$user->blocking(Page::class); // Pages that this user blocks. $user->blockers(); // Users that block this user. $user->blockers(Page::class); // Pages that block this user. @@ -223,8 +223,8 @@ $user->like($user); $user->like($page); $user->unlike($page); -$user->likings(); // Users that this user likes. -$user->likings(Page::class); // Pages that this user likes. +$user->liking(); // Users that this user likes. +$user->liking(Page::class); // Pages that this user likes. $user->likers(); // Users that like this user. $user->likers(Page::class); // Pages that like this user. diff --git a/src/Traits/CanFollow.php b/src/Traits/CanFollow.php index d29bfc4..d946249 100644 --- a/src/Traits/CanFollow.php +++ b/src/Traits/CanFollow.php @@ -4,7 +4,6 @@ use Rennokki\Befriended\Contracts\Follower; use Rennokki\Befriended\Contracts\Following; -use Rennokki\Befriended\Contracts\Followable; trait CanFollow { @@ -31,7 +30,7 @@ public function following($model = null) */ public function isFollowing($model): bool { - if (! $model instanceof Followable && ! $model instanceof Following) { + if (! $model instanceof Follower && ! $model instanceof Following) { return false; } @@ -57,7 +56,7 @@ public function follows($model): bool */ public function follow($model): bool { - if (! $model instanceof Followable && ! $model instanceof Following) { + if (! $model instanceof Follower && ! $model instanceof Following) { return false; } @@ -82,7 +81,7 @@ public function follow($model): bool */ public function unfollow($model): bool { - if (! $model instanceof Followable && ! $model instanceof Following) { + if (! $model instanceof Follower && ! $model instanceof Following) { return false; }