title: Get the latest data from database
body: <p>I need to fetch the latest data from the table. I have date passed in URL and I filter using it. So, I have something like this:</p>
  
  <pre><code>$latest = Latest::select('s_customer', 's_product', 's_starttermin')
          -&gt;leftJoin('temp_cat', 'temp_cat.spotid', '=', 'mc_spots.spotid')
          -&gt;where('s_active', '=', 1)
          -&gt;orderBy('s_starttermin', 'desc')
          -&gt;limit(50);
  
  if (!empty(Input::get('date'))) {
      $latest = $latest-&gt;where('s_starttermin', '=', Input::get('date'));
  }
  </code></pre>
  
  <p>And for example, today I do not have any latest products for <code>2017-09-28</code>. <code>$latest</code> is an empty array in that case. The last one was three days ago. How can I fetch only latest data? Reminder: I filter using <code>s_starttermin</code>...</p>