title: Method Yajra\DataTables\CollectionDataTable::where does not exist
body: <p>I have a datatable in Laravel Project. I've create a dropdown filter to filter KPI column.
  Here is my view code</p>
  <pre><code>$(function() {
  
              $.ajaxSetup({
                  headers: {
                      'X-CSRF-TOKEN': $('meta[name=&quot;csrf-token&quot;]').attr('content')
                  }
              });
  
              var table = $('.data-table').DataTable({
                  paging: true,
                  info: true,
                  autoWidth: false,
                  responsive: true,
                  processing: true,
                  serverSide: true,
                  ajax: {
                      url: &quot;{{ route('my.task') }}&quot;,
                      data: function(d) {
                          d.kpi = $('#filter-kpi').val(),
                              d.search = $('input[type=&quot;search&quot;]').val()
                      }
                  },
  
                  columns: [{
                          data: 'DT_RowIndex',
                          name: 'DT_RowIndex',
                          orderable: false,
                          searchable: false,
                      },
                      {
                          data: 'title',
                          name: 'title',
                          orderable: false,
                      },
                      {
                          data: 'content',
                          name: 'content',
                          orderable: false,
                          visible: false,
                      },
                      {
                          data: 'progress',
                          name: 'progress'
                      },
                      {
                          data: 'status',
                          name: 'status'
                      },
                      {
                          data: 'kpi',
                          name: 'kpi'
                      },
                      {
                          data: 'target_selesai',
                          name: 'target_selesai'
                      },
                      {
                          data: 'action',
                          name: 'action',
                          orderable: false,
                          searchable: false
                      },
                  ]
              });
  
              $('#createNewProduct').click(function() {
                  ...
              });
  
              $('body').on('click', '.editProduct', function() {
                 ...
              });
  
              $('body').on('click', '.detailProduct', function() {
                 ...
              });
  
              $('#saveBtn').click(function(e) {
                 ...
              });
  
              $('body').on('click', '.deleteProduct', function() {
                 ...
                      });
                  } else {
                      return false;
                  }
              });
  
  
              $('#filter-kpi').change(function() {
                  table.draw();
              });
          });
  </code></pre>
  <p>And here is my controller</p>
  <pre><code> public function MyTask(Request $request)
      {
          // if (Auth::user()-&gt;jabatan != &quot;Staff&quot;) {
          //     abort(403);
          // }
  
          if ($request-&gt;ajax()) {
              //$data = Post::where('user_id', Auth::user()-&gt;uid)-&gt;latest()-&gt;get();
              $data = Post::select('*');
              return Datatables::of($data)
                  -&gt;addIndexColumn()
                  -&gt;addColumn('action', function ($row) {
                     ... 
                  })-&gt;addColumn('target_selesai', function ($row) {
                      
                  })-&gt;addColumn('kpi', function ($row) {
                     ...                    
                  })
                  -&gt;addColumn('progress', function ($row) {
                    ...
                      }
                  })-&gt;addColumn('status', function ($row) {
                      ... 
                  })-&gt;filter(function ($instance) use ($request) {
                      if ($request-&gt;get('kpi') == '0' || $request-&gt;get('kpi') == '1') {
                          $instance-&gt;where('kpi', $request-&gt;get('kpi'));
                      }
                      if (!empty($request-&gt;get('search'))) {
                          $instance-&gt;where(function ($w) use ($request) {
                              $search = $request-&gt;get('search');
                              $w-&gt;orWhere('title', 'LIKE', &quot;%$search%&quot;)
                                  -&gt;orWhere('content', 'LIKE', &quot;%$search%&quot;);
                          });
                      }
                  })
  
                  -&gt;rawColumns(['action', 'progress', 'status'])
                  -&gt;make(true);
          }
  
          return view('task.mytask');
      }
  
  </code></pre>
  <p>My dropdown filter</p>
  <pre><code>&lt;div class=&quot;form-group&quot;&gt;
          &lt;label&gt;&lt;strong&gt;KPI :&lt;/strong&gt;&lt;/label&gt;
          &lt;select id='filter-kpi' class=&quot;form-control&quot; style=&quot;width: 200px&quot; data-column=&quot;5&quot;&gt;
              &lt;option value=&quot;&quot;&gt;Semua&lt;/option&gt;
              &lt;option value=&quot;1&quot;&gt;KPI&lt;/option&gt;
              &lt;option value=&quot;0&quot;&gt;Non-KPI&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
  </code></pre>
  <p>When I use <code>$data = Post::select('*');</code> the program works well as expected. But, I want to change it into <code>$data = Post::where('user_id', Auth::user()-&gt;uid)-&gt;latest()-&gt;get();</code> but if I use the dropdown filter it will pop up alert said &quot;Method Yajra\DataTables\CollectionDataTable::where does not exist&quot;</p>
  <p>Is there something wrong in my code? thanks in advance</p>