title: Laravel multiple orderBy()
body: <p>I have this code.</p>
  
  <pre><code>$array= $this-&gt;morphMany
  ('App\Models\Asset', 'assigned', 'assigned_type', 'assigned_to')
  -&gt;withTrashed()  
  -&gt;orderByRaw('LENGTH(name)', 'ASC')-&gt;orderBy('name', 'ASC');
  </code></pre>
  
  <p>I am using it to perform a natural search on a string with alphanumeric characters, as using an alphabetic search causes strange ordering e.g.<br>
  product1<br>
  product10<br>
  product2<br>
  product20  </p>
  
  <p>It seems to be working flawlessly.</p>
  
  <p>I have a few questions about this, mainly what is the algorithm used in orderBy? and how does the combination of both here end up giving me a natural order? I get that the combination of a length check and alphabetic check is the solution, but how does this work in laravel? is there a specific sort algorithm used here such as merge sort? I don't understand how it prioritizes one sort over the other.</p>
  
  <p>I'm a total newbie to laravel. Thanks.</p>