title: laravel datatable relationships
body: <p>So in this app <code>Drawing</code> <code>belongsTo</code> <code>Customer</code>. I have datatable </p>
  
  <pre><code>            &lt;table id='drawing-table' class="table table-bordered table-hover"&gt;
                  &lt;thead&gt;
                      &lt;tr&gt;
                          &lt;th&gt;Drawing number&lt;/th&gt;
                          &lt;th&gt;Customer&lt;/th&gt;
                      &lt;/tr&gt;
                  &lt;/thead&gt;
              &lt;/table&gt;
  </code></pre>
  
  <p>which indicates <code>$darwing-&gt;number</code> and <code>$customer-&gt;title</code>. To load info I <code>use yajra\Datatables\Datatables;</code>.</p>
  
  <p>Data  is loaded with this JS method:</p>
  
  <pre><code>$(function () {
      $('#drawing-table').DataTable({
          processing: true,
          serverSide: true,
          ajax: '{{route('drawings.datatable')}}',
          columns: [
              { data: 'number', name: 'number' },
              { data: 'customer.title', name: 'customer' },
          ]
      });
  });
  </code></pre>
  
  <p>And this Laravel method:</p>
  
  <pre><code>public function datatable()
  {
      $drawings = Drawing::select(array('drawings.id','drawings.number'));
  
      return Datatables::of(Drawing::with('customer')-&gt;select('*'))-&gt;make(true);
  }
  </code></pre>
  
  <p><strong>QUESTIONS</strong></p>
  
  <ol>
  <li>How do I make datatable search window to work with <code>$customer-&gt;title</code>?</li>
  <li>How do I display drawing number and customer title as link?</li>
  </ol>