title: Accessing multiple id columns, laravel join
body: <p>I am attempting to join three tables, and access the id column on two of them: Jobs - which shows details and job_interviews which holds the job status - accepted or declined.</p>
  
  <p>Specifically, the problem that I am having is that I need to access both id fields: the jobs.id to allow user to see the details and the job_interviews.id to send his accept or decline response. </p>
  
  <p>I set up my join like this:</p>
  
  <pre><code>public static function respondInterviews($jobID){
      return DB::table('job_interviews')
                  -&gt;join('jobs', 'jobs.id', '=', 'job_interviews.job_id')
                  -&gt;join('contractors', 'contractors.user_id', '=', 'job_interviews.send_to')
                  -&gt;where('jobs.user_id', '=', $jobID)
                  -&gt;select('jobs.id', 'job_interviews.id as interview_id', 'jobs.title', 'contractors.user_id', 'contractors.contact_name', 'job_interviews.status', 'jobs.created_at', 'jobs.budget', 'jobs.workType','job_interviews.send_to')
                  -&gt;get();
  }
  </code></pre>
  
  <p>I have attempted to set the "id" columns apart by specifying</p>
  
  <pre><code>'job_interviews.id as interview_id',
  </code></pre>
  
  <p>Then in my page view I iterate through the list of interviews and then call the two id variables:</p>
  
  <pre><code>{{$interview-&gt;id}} //which accesses jobs.id and works great
  {{$interview-&gt;interview_id}} //which is supposed to access job_interviews.id but is not working
  </code></pre>
  
  <p>The error that laravel is giving me is: </p>
  
  <pre><code>Undefined property: stdClass::$interview_id
  </code></pre>
  
  <p>How do I access the job_interviews.id column?  Thanks in advance for your help.</p>