title: Laravel Join not working as expected with DB::Raw
body: <p>So the error I am getting is <code>SQLSTATE[42S02]: Base table or view not found: 1109 Unknown table 'team_members' in field list</code> </p>
  
  <p>So it seems the join in not actually happening. Does anyone see the problem in the code?</p>
  
  <pre><code>$data = DB::select(DB::raw('
                  Select
                    team_members.name As teamMemberName,
                    Sum(TimestampDiff(minute, production_hours.time_start,
                    production_hours.time_stop)) / 60 As hoursWorked,
                    production_activities.name As groupName,
                    production_hours.team_member_id,
                    production_hours.production_activities_id,
                    production_hours.hourly_rate
                    '))
                -&gt;join('production_days', 'production_hours.production_day_id', '=', 'production_days.id')
                -&gt;join('production_activities', 'production_hours.production_activities_id', '=', 'production_activities_id')
                -&gt;where('DATE(production_day.begin)', '&gt;', $beginDate)
                -&gt;where('DATE(production_day.begin)', '&lt;', $endDate)
                -&gt;groupBy('team_members.name')
                -&gt;groupBy('production_activities.name')
                -&gt;get();
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>Mark Baker pointed out I never specified the table. The correct query(with a couple other bugs fixed):</p>
  
  <pre><code>$data = DB::table('production_days')-&gt;select(DB::raw('
                    team_members.name As teamMemberName,
                    Sum(TimestampDiff(minute, production_hours.time_start,
                    production_hours.time_stop)) / 60 As hoursWorked,
                    production_activities.name As groupName,
                    production_hours.team_member_id,
                    production_hours.production_activities_id,
                    production_hours.hourly_rate
                    '))
                -&gt;join('production_hours', 'production_hours.production_day_id', '=', 'production_days.id')
                -&gt;join('production_activities', 'production_hours.production_activities_id', '=', 'production_activities_id')
                -&gt;join('team_members', 'production_hours.team_member_id', '=', 'team_members.id')
                -&gt;where(DB::raw('DATE(`production_days`.`begin`)'), '&gt;', $beginDate)
                -&gt;where(DB::raw('DATE(`production_days`.`begin`)'), '&lt;', $endDate)
                -&gt;groupBy('team_members.name')
                -&gt;groupBy('production_activities.name')
                -&gt;get();
  </code></pre>