title: Method addEagerConstraints does not exist in Laravel
body: <p>I'm building a small application on <code>Laravel 5.6</code> where I'm having a <code>Company</code> model where I am having a <code>hasMany</code> relation to model <code>FinancialAndRisk</code> something like this:</p>
  
  
  
  <pre class="lang-php prettyprint-override"><code>class Company extends Model {
  
      use SoftDeletes;
  
      protected $fillable = [
          'name', 'slug', 'establishment', 'parent_id', 'website', 'updates'
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
          'created_at','updated_at','deleted_at'
      ];
  
      public function financial()
      {
          return $this-&gt;hasMany('Noetic\Plugins\Conxn\Models\Company\FinancialAndRisk', 'company_id');
      }
  
      public function latestFinancial()
      {
          return $this-&gt;hasMany('Noetic\Plugins\Conxn\Models\Company\FinancialAndRisk', 'company_id')-&gt;latest()-&gt;first();
      }
  
  }
  </code></pre>
  
  <p>Now at some places I want the latest financial report so I made a function <code>latestFinancial</code></p>
  
  <p>But when in my controller I do something like this:</p>
  
  <pre class="lang-php prettyprint-override"><code>public function  index()
  {
      $companies = Company::with('latestFinancial')-&gt;get();
  
      return response()-&gt;json(['companies' =&gt; $companies], 200);
  }
  </code></pre>
  
  <p>I get an error:</p>
  
  <pre class="lang-php prettyprint-override"><code>{
      "message": "Method Illuminate\\Database\\Query\\Builder::addEagerConstraints does not exist.",
      "exception": "BadMethodCallException",
      "file": "D:\\xampp\\htdocs\\conxn\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Query\\Builder.php",
      "line": 2671,
  </code></pre>
  
  <p>How can I resolve this.</p>