title: How to eager loading with laravel on a different naming convention
body: <p>I have two tables. 'weeks' and 'dates'
  The weeks table holds an 'startDate' and an 'endDate' Both columns a foreignKeys to the dates columns. The dates table holds an primary key id and the date.</p>
  <pre>
  weeks
  
  | IDweeks | startDate | endDate |
  |    1    |     2     |    6    |
  </pre>
  <pre>
  dates
  
  | IDdates | date |
  |    1    | 12-03-2018 |
  |    2    | 13-03-2018 |
  .....
  </pre>
  <p>When I query the weeks, I always get the keys for startDate and endDate. I would like to get the values from the dates tables instead.</p>
  <p>I´ve already tried to eager load the values like this:</p>
  <br>
  <h3>weeks Modal</h3>
  <pre class="lang-php prettyprint-override"><code>class weeks extends Model
  {
  //....
      public function startDate()
      {
          return $this-&gt;belongsTo('App\date', 'startDate', 'date');
      }
      public function endDate()
      {
          return $this-&gt;belongsTo('App\date', 'endDate', 'date');
      }
  //....
  
  </code></pre>
  <br>
  <h3>dates Modal</h3>
  <pre class="lang-php prettyprint-override"><code>class date extends Model
  {
  
      protected $primaryKey = 'IDdates';
  </code></pre>
  <br>
  <h3>calling the 'with()' method</h3>
  <pre class="lang-php prettyprint-override"><code>    public function showWeeks() {
          $weeks = weeks::with('startDate')-&gt;get();
          return view('weeks')-&gt;with('weeks', $weeks);
      }
  </code></pre>
  <br>
  <h3>using in the view</h3>
  <pre class="lang-php prettyprint-override"><code>
   @foreach ($weeks as $week )
      {{ $week-&gt;startDate-&gt;date }} // produces an error like: Trying to get property 'date' of non-object
      {{ $week-&gt;startDate }} // works but returns only the keys instead of the value of dates table.
  
  
  @endforeach
  </code></pre>
  <br>
  <h2>How can I load the results of the dates table when calling the weeks?</h2>
  <p>EDIT: edited a typo in the title</p>