title: Laravel hasOne through a pivot table
body: <p>So I have 2 models, User &amp; Profile, the relationship is set up as follows:</p>
  
  <pre><code>    /**
       * User belongs to many Profile
       *
       * @return \Illuminate\Database\Eloquent\Relations\belongsToMany
       */
      public function profiles()
      {
          return $this-&gt;belongsToMany('App\Models\Profile', 'user_profiles');
      }
  </code></pre>
  
  <p>I have 3 tables, users, profiles &amp; user_profiles (the pivot table)</p>
  
  <p>I have a column in my users table called <code>active_profile</code> which gets populated with a profile id. </p>
  
  <p>How can I set up the relationship so that I can call something like the following:</p>
  
  <p><code>$user-&gt;active_profile</code></p>
  
  <p>So that it will return all the profile information for the id set in active_profile?</p>