Skip to content

Commit

Permalink
remove uncomment method
Browse files Browse the repository at this point in the history
  • Loading branch information
MoamenEltouny committed Jul 10, 2022
1 parent 3f99c42 commit bcfc0ec
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
14 changes: 0 additions & 14 deletions src/Traits/Actions/Comment/isCommentable.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ public function commentBy(Model $commenter, string $body)
return $this->comments()->make(['commentable' => $this, 'comment' => $body])->commenter()->associate($commenter)->save();
}

/**
* Uncomment with a Model
*
* @param Model $commenter
* @return boolean
*/
public function unCommentBy(Model $commenter)
{
if ($comment = $this->comments()->where(['commenter_id' => $commenter->getKey(), 'commenter_type' => get_class($commenter)])->first())
return $comment->delete();

return false;
}

/**
* Has Commented By Commenter
*
Expand Down
14 changes: 0 additions & 14 deletions src/Traits/Actions/Comment/isCommenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ public function comment(Model $commentable, string $body)
return $this->comments()->make(['commenter' => $this, 'comment' => $body])->commentable()->associate($commentable)->save();
}

/**
* Uncomment Model
*
* @param Model $commentable
* @return boolean
*/
public function uncomment(Model $commentable)
{
if ($comment = $this->comments()->where(['commentable_id' => $commentable->getKey(), 'commentable_type' => get_class($commentable)])->first())
return $comment->delete();

return false;
}

/**
* Has Commented By Commenter
*
Expand Down

0 comments on commit bcfc0ec

Please sign in to comment.