title: Laravel 5.4: How to order by count(column) in eloquent?
body: <p>I am trying to display the names of assignee arranged by the most tickets <code>assigned_to</code>.</p>
  
  <pre><code>$accesses = Access::where('state','=','Assigned');
  
  $all = Report::where('state', '=', 'Assigned')
                 -&gt;union($accesses)
                 -&gt;orderBy('count(assigned_to)') //THIS IS WRONG
                 -&gt;get();
  </code></pre>