title: Laravel Nova Column in where clause is ambiguous/Unknown column in where clause
body: <ul>
  <li>Laravel Version: 5.8</li>
  <li>Nova Version: 2.0.0</li>
  <li>PHP Version: 7.2.1</li>
  <li>Operating System and Version: Max OSX 10.13.6</li>
  <li>Browser type and version: Firefox 66.0.3</li>
  </ul>
  
  <h3>Description:</h3>
  
  <p>Hi, I have 2 models relevant to this bug; Event and TimeSlot. They have a BelongsToMany relationship with each other.</p>
  
  <p>I've created an index query so that only the time slots associated with the available events are retrieved. </p>
  
  <p>The problem is that if I use <code>return $query-&gt;whereIn('id',$time_slot_ids);</code> I get a message on the Event entry that says <code>SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous</code>.</p>
  
  <p><img src="https://user-images.githubusercontent.com/24391738/56038342-98328200-5d29-11e9-85f6-20cab87e1d8d.png" alt="Screen Shot 2019-04-12 at 13 47 09"></p>
  
  <p>If I instead use <code>return $query-&gt;whereIn('time_slot_id',$time_slot_ids);</code> the query works on the Event and returns the attached time slots correctly. However this in turn leads to an error message on the Time Slots page which reads <code>SQLSTATE[42S22]: Column not found: 1054 Unknown column 'time_slot_id' in 'where clause'</code>.</p>
  
  <p><img src="https://user-images.githubusercontent.com/24391738/56038354-9f599000-5d29-11e9-89b5-1610fd52b9ea.png" alt="Screen Shot 2019-04-12 at 13 47 49"></p>
  
  <p>My full block of code;</p>
  
  <pre><code>/**
       * Build an "index" query for the given resource.
       *
       * @param  \Laravel\Nova\Http\Requests\NovaRequest  $request
       * @param  \Illuminate\Database\Eloquent\Builder  $query
       * @return \Illuminate\Database\Eloquent\Builder
       */
      public static function indexQuery(NovaRequest $request, $query)
      {
  
          if(auth()-&gt;user()-&gt;userLevel-&gt;level == 'Group') {
  
              $time_slot_ids = [];
  
              foreach(auth()-&gt;user()-&gt;group-&gt;events as $event) {
  
                  foreach($event-&gt;timeSlots as $timeSlot) {
  
                      $time_slot_ids[] = $timeSlot-&gt;id;
  
                  }
  
              }
  
              return $query-&gt;whereIn('time_slot_id',$time_slot_ids);
  
          }
  
      }
  </code></pre>
  
  <h3>Steps To Reproduce:</h3>
  
  <p>Create a User, UserLevel, Group, Event and Time Slot model and accompanying Nova resource.</p>
  
  <p>User belongs to a User Level.
  User belongs to a Group.
  User belongs to many Events.
  User belongs to many Time Slots.</p>
  
  <p>User Level has many Users.</p>
  
  <p>Group has many Users.
  Group has many Events.</p>
  
  <p>Event belongs to a Group.
  Event belongs to many Users.
  Event belongs to many Time Slots.</p>
  
  <p>Time Slot belongs to many Events.
  Time Slot belongs to many Users.</p>
  
  <p>Attempt to create an index query where only the time slots attached to the authenticated user's group's events are returned.</p>
  
  <p>Am I doing something wrong?</p>
  
  <p>Here's the full list of queries executed before I get the first error;</p>
  
  <p><a href="https://i.stack.imgur.com/9HIkJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9HIkJ.png" alt="Laravel Nova Queries"></a></p>