title: Laravel Multiple Sortby Not Working Properly
body: <p>i have some issues with laravel sortBy ( laravel 5.4 ) .. based on what i read on many websites, it says that for doing multiple sortBy laravel was by using reverse order.. so i try to do that.. but still not working properly.. </p>
  
  <p>So here it is.. 
  I have this collection of object...</p>
  
  <pre><code>[{
     'product_id' =&gt; 468,
     'name' =&gt; 'abc',
     'int_premi' =&gt; 10000
     'score' =&gt; 1000
     'rates' =&gt; 0,
     'views' =&gt; 0,
     'promo' =&gt; null
  },{
     'product_id' =&gt; 472,
     'name' =&gt; 'bcd',
     'int_premi' =&gt; 10000
     'score' =&gt; 1000
     'rates' =&gt; 0,
     'views' =&gt; 0,
     'promo' =&gt; 'Some text here'
  },{
     'product_id' =&gt; 458,
     'name' =&gt; 'def',
     'int_premi' =&gt; 10000
     'score' =&gt; 1000
     'rates' =&gt; 0,
     'views' =&gt; 0,
     'promo' =&gt; 'ABC'
  }]
  </code></pre>
  
  <p>My Goal is to have this objects sorted following this order</p>
  
  <blockquote>
    <p>score ( asc ) > int_premi ( asc ) > rates ( desc ) > promo ( as
    boolean ) ( desc ) > views ( desc ) > product_id ( desc )</p>
  </blockquote>
  
  <p>So i write this code..</p>
  
  <pre><code>$collection-&gt;sortByDesc('product_id')-&gt;sortByDesc('views')-&gt;sortByDesc(function($arr,$k){
                              return !empty($arr-&gt;promo);
      })-&gt;sortByDesc('rates')-&gt;sortBy('int_premi')-&gt;sortBy('score')-&gt;values()-&gt;all()
  </code></pre>
  
  <p>I'm looking for the result comes with this order</p>
  
  <blockquote>
    <p>BCD > DEF > ABC</p>
  </blockquote>
  
  <p>Instead, not following that order.. </p>
  
  <p>So is there anyone also facing the same issue with me ? and maybe someone can help me out through this issue ? </p>
  
  <p>Thankyou Very much</p>