title: laravel show "stats" ordered by date and counts
body: <p>I want to show the stats of visitors on my website,</p>
  
  <p>What I have:</p>
  
  <blockquote>
    <p>AdminClontroller</p>
  </blockquote>
  
  <pre><code>public function index()
      {
  
          $select_stats = DB::table('visitor')-&gt;whereBetween('visit_date', array(date('Y-m-01'), date('Y-m-t')))-&gt;get();
  
          $month = date('m');
  
          $get_count = DB::select(DB::raw("SELECT count(*) FROM visitor WHERE MONTH(date) = $month GROUP BY DAY(date)"));
  
  
          foreach($select_stats as $statics) {
  
         //change our object to an array
         $statics = array();
          }
  
  
      return View::make('admin.home.index')-&gt;with('stats', $select_stats)/*-&gt;with('count', $get_count)*/;
  
      }
  </code></pre>
  
  <blockquote>
    <p>database model</p>
  </blockquote>
  
  <p><img src="https://i.stack.imgur.com/yfNAS.png" alt="database model"></p>
  
  <blockquote>
    <p>View</p>
  </blockquote>
  
  <pre><code>var visitors = [
  @foreach($stats as $stat)
                  ['{{ date("d/m/Y", strtotime($stat-&gt;date)) }}', 55],
  @endforeach
              ];
  </code></pre>
  
  <p>I want to get a stat like this:</p>
  
  <p><img src="https://i.stack.imgur.com/pEctI.png" alt="stats"></p>
  
  <p>But with the correct data from the database.</p>
  
  <p>I want that I get the count of all IP's that visited my site on day 'x', and that for a month long.</p>
  
  <p>So: on 2015-04-14 I got 20 visits, that is what I want to get, but looped in my template.</p>
  
  <p>I hope you guys do understand me.</p>
  
  <p>Kindest regards,</p>