title: Why is my eager loading failing with "BadMethodCallException with message 'Call to undefined method Illuminate\Database\Query\Builder::profile()"
body: <p>Here are my table structures:</p>
  
  <pre><code>users
  
  id INT 10
  name VARCHAR 255
  email VARCHAR 255
  password VARCHAR 255
  remember_token VARCHAR 255
  created_at TIMESTAMP
  updated_at TIMESTAMP
  
  profiles
  
  id INT 10
  user_id INT 11
  address1 VARCHAR 255
  address2 VARCHAR 255
  city VARCHAR 255
  postcode VARCHAR 255
  country_id INT 11
  location VARCHAR 255
  created_at TIMESTAMP
  updated_at TIMESTAMP
  
  countries
  
  id INT 10
  name VARCHAR 255
  currency VARCHAR 255
  currency_code CHAR 3
  iso2 CHAR 2
  iso3 CHAR 3
  locale VARCHAR 255
  </code></pre>
  
  <p>The model App\User.php</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Foundation\Auth\User as Authenticatable;
  
  class User extends Authenticatable
  {
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'name', 'email', 'password',
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
          'password', 'remember_token',
      ];
  
      /**
       * Relating profile to user
       * 
       * @return type
       */
      public function profile()
      {
          return $this-&gt;hasOne('App\Profile');
      }
  }
  </code></pre>
  
  <p>The model App\Profile.php</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Profile extends Model
  {
  
      public function user()
      {
          return $this-&gt;belongsTo(User::class);
      }
  
  
  
      /**
       * Relating country to profile
       * 
       * @return type
       */
      public function country()
      {
          return $this-&gt;belongsTo('App\Country' ,'country_id', 'id');
      }
  
  }
  </code></pre>
  
  <p>The model App\Country.php</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Country extends Model
  {
  
  
      /**
       * Relating profile to country
       * 
       * @return type
       */
      public function profiles()
      {
          return $this-&gt;hasMany('App\Profile', 'country_id');
      }
  
  }
  </code></pre>
  
  <p>In "php artisan tinker", I get the following results</p>
  
  <pre><code>$profile = App\Profile::with('user')-&gt;whereId(1)-&gt;first();
  =&gt; App\Profile {#762
       id: 1,
       user_id: 1,
       address1: "8 Acacia Way"
       address2: null,
       city: "Sheffield",
       postcode: "S9 7TJ",
       country_id: 198,
       location: null,
       created_at: "2016-06-17 22:03:11",
       updated_at: "2016-06-17 22:03:11",
       user: App\User {#767
         id: 1,
         name: "David Smith",
         email: "dsmith1865@hotmail.com",
         created_at: "2016-06-16 22:15:43",
         updated_at: "2016-06-16 22:15:43",
       },
     }
  
  $profile = App\Profile::with('country')-&gt;whereId(1)-&gt;first();
  Illuminate\Database\QueryException with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'countries.profile_id' in 'where clause' (SQL: select * from `countries` where `countries`.`profile_id` in (1))'
  
  $country = App\Country::with('profile')-&gt;whereId(198)-&gt;first();
  BadMethodCallException with message 'Call to undefined method Illuminate\Database\Query\Builder::profile()'
  </code></pre>
  
  <p>Why can't I eager load countries with profiles or profiles with countries?  Can someone please explain.</p>