title: Sort ServerSide DataTable on calculated / formatted value that is not a column in the DB
body: <p>I've been using <a href="https://datatables.yajrabox.com/" rel="nofollow noreferrer">Laravel Datatables</a> for awhile in some of the Laravel applications and I really love that, and probably using a fraction of the features.  I also have some legacy PHP applications that can use Composer and it is an MVC framework, but not Laravel.</p>
  <p><a href="https://datatables.net/examples/server_side/simple.html" rel="nofollow noreferrer">DataTables Server Side Example</a>, and that provides some of the same features, with the important exception that I can do something like this with the Laravel version:</p>
  <pre><code>...
  $query = 'Some complex query with JOINS, WHERES, ETC&quot;;
  $data = DB::connection('mysql2')-&gt;select($query, $where_clause_params);
  return Datatables::of($data)
  -&gt;addIndexColumn()
  -&gt;editColumn('patient_lname', function ($row) {
       return $row-&gt;patient_lname.'&lt;br&gt;Sex:  '.$row-&gt;patient_sex.'&lt;br&gt;DOB:  '.$row-&gt;patient_birth_date;
   })
   .....
  </code></pre>
  <p>whereas the Datatables uses something like this:</p>
  <pre><code> . . .
   $table = 'exams';
    $primaryKey = 'requested_procedure_id';
   $columns = array(
      array(
          'db'=&gt; 'requested_procedure_id',
          'dt'=&gt; 'requested_procedure_id'),
       array(
          'db' =&gt; 'exam_name',
          'dt' =&gt; 'exam_name' ),
      . . .
  </code></pre>
  <p>The Laravel version seems to have many more capabiities maybe because it leverages Eloquent.</p>
  <p>It does seem like it might be possible to to extend the capabilities of the vanilla Datatables version by creating a MySQL View that has columns with all of the values that I want to display in the datatable, such that I can search and sort on that value.</p>
  <p>Just wondering if you can do something like that with DataTables and Views ?</p>
  <p>This SO post might be relevant:  <a href="https://stackoverflow.com/questions/39183330/datatables-php-server-side-processing-on-multiple-tables">Datatables.net's Server-Side Processing (SSP) with PHP</a></p>
  <p>I mostly want to tidy-up the legacy app and any new work will likely use Laravel, which has more features.  Just not sure what might be the best approach.</p>