Example #1
0
 /**
  * User unlike post
  * @author  Tran Van Moi
  * @since  2015/05/21
  * @param  int $user_id
  * @param  int $post_id
  * @return  int
  */
 public static function unlike($user_id, $post_id)
 {
     $like = Like::whereUser_id($user_id)->wherePost_id($post_id)->first();
     if ($like->delete()) {
         return true;
     } else {
         return false;
     }
 }