title: how to change the response of a datatable?, laravel
body: <p>I have my project in laravel stored in a subdirectory and I am using datatables, however, when I want to recover the information, I get the typical error "invalid json" , my project url is as follows</p>
  
  <p><a href="http://www.loupper.com/loupper-b/public/" rel="nofollow noreferrer">http://www.loupper.com/loupper-b/public/</a></p>
  
  <p>but the answer I get is this</p>
  
  <blockquote>
    <p><strong><a href="http://www.loupper.com/subcategory/data" rel="nofollow noreferrer">http://www.loupper.com/subcategory/data</a></strong>?draw=1&amp;columns%5B0%5D%5Bdata%5D=checkmark&amp;columns%5B0%5D%5Bname%5D=id&amp;columns%5B0%5D%5Bsearchable%5D=false&amp;columns%5B0%5D%5Borderable%5D=false&amp;columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&amp;columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&amp;columns%5B1%5D%5Bdata%5D=subcategoria&amp;columns%5B1%5D%5Bname%5D=subcategoria&amp;columns%5B1%5D%5Bsearchable%5D=true&amp;columns%5B1%5D%5Borderable%5D=true&amp;columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&amp;columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&amp;columns%5B2%5D%5Bdata%5D=categoria&amp;columns%5B2%5D%5Bname%5D=categoria&amp;columns%5B2%5D%5Bsearchable%5D=true&amp;columns%5B2%5D%5Borderable%5D=true&amp;columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&amp;columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&amp;columns%5B3%5D%5Bdata%5D=action&amp;columns%5B3%5D%5Bname%5D=action&amp;columns%5B3%5D%5Bsearchable%5D=false&amp;columns%5B3%5D%5Borderable%5D=false&amp;columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&amp;columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&amp;order%5B0%5D%5Bcolumn%5D=1&amp;order%5B0%5D%5Bdir%5D=desc&amp;start=0&amp;length=10&amp;search%5Bvalue%5D=&amp;search%5Bregex%5D=false&amp;_=1505922295346</p>
  </blockquote>
  
  <p>it seems, the route has not taken the subdirectories "loupper-b/public/" ,how could I add subdirectories to the url?</p>
  
  <p>this is my code, jquery</p>
  
  <pre><code>$(function () {
  $.noConflict();
  
  user_tbl = $('#categoria-table').DataTable({
      processing: true,
      serverSide: true,
      order: [[1, 'desc']],
      ajax: {
          url: '/category/data',
          data: function (d) {
            d.filter = $('select[name=filter]').val();
  
          },
  
      },
      columns: [
          {data: 'checkmark', name:'id', orderable: false, searchable: false},
          {data: 'nombre', name: 'nombre'},
          {data: 'action', name: 'action', orderable: false, searchable: false, class:"text-center"}
      ]
  });
  
  $('#search-form').on('submit', function(e) {
      user_tbl.draw();
      e.preventDefault();
      return false;
       });
  
     });
  </code></pre>
  
  <p>laravel</p>
  
  <pre><code>public function indexDatatable()
  {
      $categoria=DB::table("categoria")-&gt;select("id","nombre")-&gt;get();
  
      return Datatables::of($categoria)
      -&gt;addColumn('action', function ($categoria) {
  
                  return '&lt;button onClick=deleteCategoria('.$categoria-&gt;id.'); type="button" class="btn btn-xs btn-danger" data-id="'.$categoria-&gt;id.'"&gt;&lt;i class="glyphicon glyphicon-trash"&gt;&lt;/i&gt;&lt;/button&gt;&lt;a href="/categoria/edit/'.$categoria-&gt;id.'" class="btn btn-xs btn-primary f-left"&gt;&lt;i class="fa fa-pencil"&gt;&lt;/i&gt;&lt;/a&gt;';
  
      })
     -&gt;editColumn('checkmark', function($categoria) {
          return '&lt;input type="checkbox" id="chk" name="chk[]" class="case" value="'.$categoria-&gt;id.'"&gt;';
       })
  
      -&gt;rawColumns(['checkmark','action'])
      -&gt;make(true);
  
  }
  </code></pre>