diff --git a/src/Traits/Actions/Bookmark/isBookmaker.php b/src/Traits/Actions/Bookmark/isBookmaker.php index 2f33338..61496af 100644 --- a/src/Traits/Actions/Bookmark/isBookmaker.php +++ b/src/Traits/Actions/Bookmark/isBookmaker.php @@ -30,7 +30,7 @@ public function bookmark(Model $bookmarkable, array $data = null) if ($bookmark = $this->getBookmark($bookmarkable)) { return $bookmark->update(['data' => $data]); } else { - return $this->bookmarks()->make(['bookmarker' => $this, 'data' => $data])->bookmarkable()->associate($bookmarkable)->save(); + return $this->bookmarks()->make(['data' => $data])->bookmarkable()->associate($bookmarkable)->save(); } } diff --git a/src/Traits/Actions/Bookmark/isBookmarkable.php b/src/Traits/Actions/Bookmark/isBookmarkable.php index 1febc66..e6c3c3c 100644 --- a/src/Traits/Actions/Bookmark/isBookmarkable.php +++ b/src/Traits/Actions/Bookmark/isBookmarkable.php @@ -30,7 +30,7 @@ public function bookmarkBy(Authenticatable $bookmarker, array $data = null) if ($bookmark = $this->getBookmark($bookmarker)) { return $bookmark->update(['data' => $data]); } else { - return $this->bookmarks()->make(['bookmarkable' => $this, 'data' => $data])->bookmarker()->associate($bookmarker)->save(); + return $this->bookmarks()->make(['data' => $data])->bookmarker()->associate($bookmarker)->save(); } } diff --git a/src/Traits/Actions/Comment/isCommentable.php b/src/Traits/Actions/Comment/isCommentable.php index 62e7680..5c09ef8 100644 --- a/src/Traits/Actions/Comment/isCommentable.php +++ b/src/Traits/Actions/Comment/isCommentable.php @@ -14,9 +14,9 @@ trait isCommentable * @param string $comment * @return boolean */ - public function commentBy(Authenticatable $commenter, string $body) + public function commentBy(Authenticatable $commenter, string $comment) { - return $this->comments()->make(['commentable' => $this, 'comment' => $body])->commenter()->associate($commenter)->save(); + return $this->comments()->make(['comment' => $comment])->commenter()->associate($commenter)->save(); } /** diff --git a/src/Traits/Actions/Comment/isCommenter.php b/src/Traits/Actions/Comment/isCommenter.php index 63ae50d..c51783a 100644 --- a/src/Traits/Actions/Comment/isCommenter.php +++ b/src/Traits/Actions/Comment/isCommenter.php @@ -14,9 +14,9 @@ trait isCommenter * @param string $comment * @return boolean */ - public function comment(Model $commentable, string $body) + public function comment(Model $commentable, string $comment) { - return $this->comments()->make(['commenter' => $this, 'comment' => $body])->commentable()->associate($commentable)->save(); + return $this->comments()->make(['comment' => $comment])->commentable()->associate($commentable)->save(); } /** diff --git a/src/Traits/Actions/Favourite/isFavorer.php b/src/Traits/Actions/Favourite/isFavorer.php index d7ebe68..2c0c4bf 100644 --- a/src/Traits/Actions/Favourite/isFavorer.php +++ b/src/Traits/Actions/Favourite/isFavorer.php @@ -18,7 +18,7 @@ public function favourite(Model $favourable) if ($this->favoured($favourable)) return true; - return $this->favourites()->make(['favorer' => $this])->favourable()->associate($favourable)->save(); + return $this->favourites()->make()->favourable()->associate($favourable)->save(); } /** diff --git a/src/Traits/Actions/Favourite/isFavourable.php b/src/Traits/Actions/Favourite/isFavourable.php index 8b96d8e..2ba3589 100644 --- a/src/Traits/Actions/Favourite/isFavourable.php +++ b/src/Traits/Actions/Favourite/isFavourable.php @@ -18,7 +18,7 @@ public function favouriteBy(Authenticatable $favorer) if ($this->favouredBy($favorer)) return true; - return $this->favourites()->make(['favourable' => $this])->favorer()->associate($favorer)->save(); + return $this->favourites()->make()->favorer()->associate($favorer)->save(); } /** diff --git a/src/Traits/Actions/Follow/isFollowable.php b/src/Traits/Actions/Follow/isFollowable.php index d821ac0..11ac3e8 100644 --- a/src/Traits/Actions/Follow/isFollowable.php +++ b/src/Traits/Actions/Follow/isFollowable.php @@ -18,7 +18,7 @@ public function followBy(Authenticatable $follower) if ($this->followedBy($follower)) return true; - return $this->follows()->make(['followable' => $this])->follower()->associate($follower)->save(); + return $this->follows()->make()->follower()->associate($follower)->save(); } /** diff --git a/src/Traits/Actions/Follow/isFollower.php b/src/Traits/Actions/Follow/isFollower.php index 6b237ba..0829c3a 100644 --- a/src/Traits/Actions/Follow/isFollower.php +++ b/src/Traits/Actions/Follow/isFollower.php @@ -18,7 +18,7 @@ public function follow(Model $followable) if ($this->followed($followable)) return true; - return $this->follows()->make(['follower' => $this])->followable()->associate($followable)->save(); + return $this->follows()->make()->followable()->associate($followable)->save(); } /** diff --git a/src/Traits/Actions/Like/isLikeable.php b/src/Traits/Actions/Like/isLikeable.php index dcea022..b00970e 100644 --- a/src/Traits/Actions/Like/isLikeable.php +++ b/src/Traits/Actions/Like/isLikeable.php @@ -18,7 +18,7 @@ public function likeBy(Authenticatable $liker) if ($this->likedBy($liker)) return true; - return $this->likes()->make(['likeable' => $this])->liker()->associate($liker)->save(); + return $this->likes()->make()->liker()->associate($liker)->save(); } /** diff --git a/src/Traits/Actions/Like/isLiker.php b/src/Traits/Actions/Like/isLiker.php index 0a5ddf7..53eeb61 100644 --- a/src/Traits/Actions/Like/isLiker.php +++ b/src/Traits/Actions/Like/isLiker.php @@ -18,7 +18,7 @@ public function like(Model $likeable) if ($this->liked($likeable)) return true; - return $this->likes()->make(['liker' => $this])->likeable()->associate($likeable)->save(); + return $this->likes()->make()->likeable()->associate($likeable)->save(); } /** diff --git a/src/Traits/Actions/Review/isReviewable.php b/src/Traits/Actions/Review/isReviewable.php index 39dea7a..5c3f9f7 100644 --- a/src/Traits/Actions/Review/isReviewable.php +++ b/src/Traits/Actions/Review/isReviewable.php @@ -35,7 +35,6 @@ public function reviewBy(Authenticatable $reviewer, float $rate = 0, string $com ]); } else { return $this->reviews()->make([ - 'reviewable' => $this, 'rate' => $rate, 'comment' => $comment ])->reviewer()->associate($reviewer)->save(); diff --git a/src/Traits/Actions/Review/isReviewer.php b/src/Traits/Actions/Review/isReviewer.php index f1ee3e8..3c20245 100644 --- a/src/Traits/Actions/Review/isReviewer.php +++ b/src/Traits/Actions/Review/isReviewer.php @@ -35,7 +35,6 @@ public function review(Model $reviewable, float $rate = 0, string $comment = nul ]); } else { return $this->reviews()->make([ - 'reviewer' => $this, 'rate' => $rate, 'comment' => $comment, ])->reviewable()->associate($reviewable)->save(); diff --git a/src/Traits/Actions/Subscribe/isSubscribable.php b/src/Traits/Actions/Subscribe/isSubscribable.php index ff83029..6801b8d 100644 --- a/src/Traits/Actions/Subscribe/isSubscribable.php +++ b/src/Traits/Actions/Subscribe/isSubscribable.php @@ -18,7 +18,7 @@ public function subscribeBy(Authenticatable $subscriber) if ($this->subscribedBy($subscriber)) return true; - return $this->subscriptions()->make(['subscribable' => $this])->subscriber()->associate($subscriber)->save(); + return $this->subscriptions()->make()->subscriber()->associate($subscriber)->save(); } /** diff --git a/src/Traits/Actions/Subscribe/isSubscriber.php b/src/Traits/Actions/Subscribe/isSubscriber.php index 7f0ecdb..b9be12f 100644 --- a/src/Traits/Actions/Subscribe/isSubscriber.php +++ b/src/Traits/Actions/Subscribe/isSubscriber.php @@ -18,7 +18,7 @@ public function subscribe(Model $subscribable) if ($this->subscribed($subscribable)) return true; - return $this->subscriptions()->make(['subscriber' => $this])->subscribable()->associate($subscribable)->save(); + return $this->subscriptions()->make()->subscribable()->associate($subscribable)->save(); } /** diff --git a/src/Traits/Actions/Vote/isVotable.php b/src/Traits/Actions/Vote/isVotable.php index 211a45f..5325990 100644 --- a/src/Traits/Actions/Vote/isVotable.php +++ b/src/Traits/Actions/Vote/isVotable.php @@ -29,7 +29,7 @@ public function voteUpBy(Authenticatable $voter) if ($vote = $this->getVote($voter)) { return $vote->update(['vote' => true]); } else { - return $this->votes()->make(['votable' => $this, 'vote' => true])->voter()->associate($voter)->save(); + return $this->votes()->make(['vote' => true])->voter()->associate($voter)->save(); } } @@ -44,7 +44,7 @@ public function voteDownBy(Authenticatable $voter) if ($vote = $this->getVote($voter)) { return $vote->update(['vote' => false]); } else { - return $this->votes()->make(['votable' => $this, 'vote' => false])->voter()->associate($voter)->save(); + return $this->votes()->make(['vote' => false])->voter()->associate($voter)->save(); } } diff --git a/src/Traits/Actions/Vote/isVoter.php b/src/Traits/Actions/Vote/isVoter.php index 43253f7..88c1638 100644 --- a/src/Traits/Actions/Vote/isVoter.php +++ b/src/Traits/Actions/Vote/isVoter.php @@ -29,7 +29,7 @@ public function voteUp(Model $votable) if ($vote = $this->getVote($votable)) { return $vote->update(['vote' => true]); } else { - return $this->votes()->make(['voter' => $this, 'vote' => true])->votable()->associate($votable)->save(); + return $this->votes()->make(['vote' => true])->votable()->associate($votable)->save(); } } @@ -44,7 +44,7 @@ public function voteDown(Model $votable) if ($vote = $this->getVote($votable)) { return $vote->update(['vote' => false]); } else { - return $this->votes()->make(['voter' => $this, 'vote' => false])->votable()->associate($votable)->save(); + return $this->votes()->make(['vote' => false])->votable()->associate($votable)->save(); } }