title: LARAVEL | Group By Query Edit
body: <p>I'm have this query:</p>
  <pre><code>        $result_status_count = TWTask::whereRelation('assignee', 't_w_assignees.user_id', $user-&gt;id)
          -&gt;groupBy('status_id', 't_w_statuses.name') // count all task group by status for all users.
          -&gt;join('t_w_statuses', 't_w_statuses.id', 't_w_tasks.status_id')
          -&gt;selectRaw('t_w_statuses.name, count(*)')
          -&gt;get();
  </code></pre>
  <p>and the result is:</p>
  <p><a href="https://i.stack.imgur.com/c05t8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c05t8.png" alt="enter image description here" /></a></p>
  <p>but I'm  need the Result Like:</p>
  <pre><code>[
   {
     &quot;Processing&quot;: 1
   },
   {
     &quot;Rejected&quot;: 4
   },
   { 
     &quot;Completed&quot;: 6
   }
  ]
  </code></pre>