title: get total count in each ids from different table in laravel
body: <p>i want to get each id's total count from another table named assign job. i saved user data into my users table and i add 3 jobs into assign job table with user id.</p>
  
  <p>but now i want to get total added jobs from assign job table where user ids in my users table at once.</p>
  
  <p>I wrote this function </p>
  
  <pre><code>$assignjob = DB::table('users')
  -&gt;join('assign_jobs', 'users.user_id', '=', 'assign_jobs.user_id')
  -&gt;get()
  -&gt;count(); 
  </code></pre>
  
  <p>but this shows me total count in my assign job table. but i want to get different count for each user ids.</p>
  
  <p>i want to assign different color rows with this assign job total count values.</p>
  
  <p>can any one help me.</p>
  
  <p><strong>User Table:</strong></p>
  
  <pre><code>|---------------------|------------------|
  |      user_id        |     name         |
  |---------------------|------------------|
  |          123        |     john         |
  |---------------------|------------------|
  |          234        |     peter        |
  |---------------------|------------------|
  </code></pre>
  
  <p><strong>assign job table:</strong></p>
  
  <pre><code>|---------------------|------------------|
  |      id             |     user_id      |
  |---------------------|------------------|
  |          1          |     123          |
  |---------------------|------------------|
  |          2          |     123          |
  |---------------------|------------------|
  |          3          |     234          |
  |---------------------|------------------|
  |          4          |     234          |
  |---------------------|------------------|
  </code></pre>