title: Can't reverse eloquent relationships in Laravel
body: <p>On my Laravel app, I'm currently working on users being able to "block" other users.</p>
  
  <p>In my users model, I try to define the "blocked" relationships between users:</p>
  
  <pre><code>public function blockedOfMine() {
      return $this-&gt;belongsToMany('CommendMe\Models\User', 'blocked', 'user_id', 'blocked_id');
  }
  
  public function blockedBy() {
      return $this-&gt;belongsToMany('CommendMe\Models\User', 'blocked', 'blocked_id', 'user_id');
  }
  
  public function blocked() {
      return $this-&gt;blockedOfMine()-&gt;get();
  }
  
  public function blockedMe() {
      return $this-&gt;blockedBy()-&gt;get();
  }
  
  public function isBlocked(User $user) {
      return (bool) $this-&gt;blocked()-&gt;where('id', $user-&gt;id)-&gt;count();
  }
  
  public function hasBlockedMe(User $user) {
      return (bool) $this-&gt;blockedMe()-&gt;where('id', $user-&gt;id)-&gt;count();
  }   
  </code></pre>
  
  <p>Basically, this model is only trying to figure out whether a user has blocked another user (function isBlocked) or whether a user has been blocked by another user (function hasBlockedMe).</p>
  
  <p>Now, the first function works just fine, however the second one doesn't, despite them being completely the same:</p>
  
  <pre><code>if (Auth::user()-&gt;isBlocked($user)) {
     return redirect()-&gt;back()-&gt;with('info', 'You cannot message blocked users.');    
  }
  if (Auth::user()-&gt;hasBlockedMe($user)) {
     return redirect()-&gt;back()-&gt;with('info', 'This user has blocked communications with you.');   
  }   
  </code></pre>
  
  <p>so if I try to message a user who is blocked, I get the message "You cannot message blocked users.", but the message goes through perfectly fine when I try to message a user who has blocked me. </p>
  
  <p>What am I doing wrong?</p>