title: Order by as Number, even if column type is string, Laravel
body: <p>I have a string column, but I have only double numbers (age), and I want to do a order by, but the obvious problem is that i get wrong response, because is string. ex: (1,10,2,3,4,40,etc...). In my code $table = name of the table, sort_by, in this particular case is "age".</p>
  
  <pre><code>$query-&gt;orderBy("CAST(" . $table . $request-&gt;sort_by . "as NUMERIC)", 'ASC');
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>Undefined table: 7 ERROR:  missing FROM-clause entry for table
    "CAST(people"↵LINE 1:</p>
  </blockquote>