title: how we can count items by id in database using laravel
body: <p>count items by id in sub category table</p>
  <pre><code>$count = DB::table('sub_category')
                 -&gt;select count(*) as 
                 -&gt;where('cat_id', $id)
  </code></pre>
  <p>error show</p>
  <blockquote>
  <p>FatalErrorException in BasicController.php line 51:</p>
  <p>syntax error, unexpected 'count' (T_STRING)</p>
  </blockquote>