title: Laravel 5.2 left join one to many only row with column of highest value
body: <p>I am trying to do a left join using eloquent on a one to many relationship. I would only like to get the row with the highest value in the sort_order column.</p>
  
  <p>So far my query looks like this:</p>
  
  <pre><code>Package::select('packages.*')
          -&gt;leftJoin('package_routes', 'package_routes.package_id', '=', 'packages.id')
          -&gt;leftJoin('package_route_items', function($join){
              $join-&gt;on('package_route_items.package_route_id', '=', 'package_routes.id')
                  -&gt;where(???);
          })-&gt;...//do more stuff to query here
  </code></pre>
  
  <p>I'm stuck on the where clause, if I should even be using a where at all.</p>