title: orderBy not working in laravel + datatable
body: <p>I simply want to get the latest date/time per customer id but the orderBy code seems to not be working. I've tried using first but I keep on getting datatable error 7.</p>
  
  <p>controller</p>
  
  <pre><code>public function refresh(){
      $cash_advance = DB::table('cash_advance')
          -&gt;join('customer', 'customer.id', '=', 'cash_advance.customer_id')
          -&gt;select('cash_advance.customer_id', 'customer.fname', 'customer.mname', 'customer.lname', 'cash_advance.amount', 'cash_advance.created_at', 'cash_advance.balance')
          -&gt;groupBy('cash_advance.customer_id')
          -&gt;orderBy('cash_advance.created_at', 'desc')
          -&gt;get();
      return \DataTables::of($cash_advance)
      -&gt;addColumn('action', function($cash_advance){
          return '&lt;button class="btn btn-xs btn-info" id="'.$cash_advance-&gt;customer_id.'"&gt;&lt;i class="material-icons" style="width: 25px;"&gt;visibility&lt;/i&gt;&lt;/button&gt;';//info/visibility
      })
      -&gt;make(true);
  }
  </code></pre>
  
  <p>datatable</p>
  
  <pre><code>var cash_advancetable = $('#cash_advancetable').DataTable({
              dom: 'Bfrtip',
              buttons: [
              ],
              processing: true,
              serverSide: true,
              ajax: "{{ route('refresh_cashadvance') }}",
              columns: [
                  {render: function(data, type, full, meta){
                      return full.fname +" "+full.mname+" "+full.lname;
                  }},
                  {data: 'amount', name: 'amount'},
                  {data: 'created_at', name: 'created_at'},
                  {data: 'balance', name: 'balance'},
                  {data: "action", orderable:false,searchable:false}
              ]
          });
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/diD5y.png" rel="nofollow noreferrer">output</a>
  <a href="https://i.stack.imgur.com/Ze9zQ.png" rel="nofollow noreferrer">database</a></p>