title: Getting empty array on Laravel eloquent relationship HasManyThrough
body: <p>I'm making a sort of like reddit website.</p>
  
  <p>I need query that would give me the profile of the user and his karmas through the threads that the user have made.</p>
  
  <p>Tables and relationship:  </p>
  
  <blockquote>
    <p>User has one profile<br>
     User has many threadKarmaPoints through threads</p>
  </blockquote>
  
  <pre><code>    public function threadKarmaPoints() {
      return $this-&gt;hasManyThrough(
          'App\Models\ThreadKarmaView',
          'App\Models\ThreadView',
          'userId',
          'threadId',
          'userId',
          'threadId');
  }
  </code></pre>
  
  <p>Query: (I need to get the user through username and not by id)</p>
  
  <pre><code>$user = UserView::where('username', $username)
              -&gt;with(['profile', 'threadKarmaPoints'])
              -&gt;firstOrFail();
  </code></pre>
  
  <p>This gives me empty array. Although if I remove the <code>'threadKarmaPoints'</code> in with, it gives me the user and his profile so I think there must be wrong with my <code>threadKarmaPoints</code> relationship. </p>
  
  <p>Additional question: in eloquent query, should <code>-&gt;with()</code> comes first or <code>-&gt;where()</code>? </p>