title: Count number of row using mysql query in laravel
body: <p>I trying to use Laravel <code>count()</code> function to get the count of row. I have below code to count the number of row of 2 join table. </p>
  
  <p>Example 1: </p>
  
  <pre><code>$row = DB::table('log_user_login')
                  -&gt;select(DB::raw('log_user_login.Password as LogPassword'), 'user.*')
                  -&gt;join('user', 'log_user_login.Username', '=', 'user.Username')
                  -&gt;where('log_user_login.LoginSession', '!=', '')
                  -&gt;groupBy('user.ID')
                  -&gt;get();
  $count = sizeof($row);
  </code></pre>
  
  <p>Example 2: </p>
  
  <pre><code>$count = DB::table('log_user_login')
              -&gt;select(DB::raw('log_user_login.Password as LogPassword'), 'user.*')
              -&gt;join('user', 'log_user_login.Username', '=', 'user.Username')
              -&gt;where('log_user_login.LoginSession', '!=', '')
              -&gt;groupBy('user.ID')
              -&gt;count();
  </code></pre>
  
  <p>When I <code>echo $count</code> form Example 1, the number of <code>$count</code> is 15415. But <code>$count</code> of Example 2 return me 89. May I know why this happen and how can I get the number of row without using the <code>get()</code>?</p>