title: How to convert my sql query to laravel ORM
body: <p>I'm new in laravel 5 how can i convert this query to laravel ORM</p>
  
  <pre><code>select m.nombre,c.fecha_control as primer_control,
  (select control.fecha_control 
    from control 
    where m.id = control.id_mascota
    order by control.fecha_control 
    DESC limit 1) as ultimo_control
  from mascota m
  left join control as c on m.id = c.id_mascota
  GROUP BY m.nombre
  </code></pre>
  
  <p>i try this but it didn't work...</p>
  
  <pre><code> DB::table('mascota as m')
          -&gt;leftJoin('control as c','m.id','=','c.id_mascota')
          -&gt;select('m.nombre','c.fecha_control as primer_control',
              \DB::raw('select control.fecha_control  from control 
                          where m.id = control.id_mascota
                          order by control.fecha_control 
                          DESC limit 1
                          ) as ultimo_control'))
          -&gt;groupBy('m.id');
  </code></pre>
  
  <p>Thanks </p>