title: How to display data on datatables using laravel 5?
body: <p>I am using laravel 5 and I want to show field in jenis_surat column in database to my table using datatables. I want to using JSON, do you know how to show the number depends on the entries of the data. <br>here is my controller (It's just shows data in jenis_surat):</p>
  
  <pre><code>public function jenissurat()
  {return view('jenissurat');}
  
    public function datajenissurat()
  {
      $jenissurat = new JenisSurat();
      $jenissurats = $jenissurat-&gt;select('jenis_surat')-&gt;get();   
      return $jenissurats;
  }
  </code></pre>
  
  <p>And how to display it on datatables? example:<br><br> No. Jenis Surat. .Action<br>1.   .   .A    .     .    .  .  .   .   .  .  . Edit | Delete<br>2.   .   .B    .     .    .  .  .   .   .  .  . Edit | Delete<br>3.   .   .F    .     .    .  .  .   .   .  .  . Edit | Delete<br></p>
  
  <pre><code>&lt;table id="jenissurat" class="table table-bordered table-striped" cellspacing="0" widht="100%"&gt;
            &lt;thead&gt;
              &lt;tr&gt;
                &lt;th width="4%"&gt;No.&lt;/th&gt;
                &lt;th width="80%"&gt;Jenis Surat&lt;/th&gt;
                &lt;th width="16%"&gt;Action&lt;/th&gt;
              &lt;/tr&gt;
            &lt;/thead&gt;
          &lt;/table&gt;
          &lt;script type="text/javascript"&gt;
  
            $(document).ready(function(){
              $('#publish').DataTable({
                'columns' : [
                  {'data' : 'jenis_surat'}
                ]
              });
            });
  
          &lt;/script&gt;
  </code></pre>
  
  <p>Here is my route:</p>
  
  <pre><code>Route::get('/jenissurat', [
  'uses' =&gt; 'SuratController@jenissurat',
  'as' =&gt; 'jenissurat'
  ]); Route::get('/datajenissurat', [
  'uses' =&gt; 'SuratController@datajenissurat',
  'as' =&gt; 'datajenissurat'
  ]);here
  </code></pre>