title: How to solve Integrity constraint violation: 1052 Column 'agent_id' in where clause is ambiguous
body: <p>Integrity constraint violation: 1052 Column 'agent_id' in where clause is ambiguous</p>
  
  <p>I have try but still can't find the error of this datatables</p>
  
  <pre><code>public function customerOrderList(Request $request, $agent_id){
      $customer_orders = CustomerOrder::join('agent as a', 'a.agent_id','=','customer_order.agent_id')
      -&gt;select('customer_order.*', 'a.name as agent_name')
      -&gt;where('agent_id', $agent_id)
      -&gt;get();
  
      $datatables = DataTables::of($customer_orders)
      -&gt;addColumn('actions', function($customer_order){
        $html ='';
        $view = route('customer-order.invoice', $customer_order-&gt;doc_id);
        $html .= "&lt;a class='btn btn-primary btn-sm' href='$view'&gt;&lt;i class='far fa-fw fa-eye'&gt;&lt;/i&gt;&lt;/a&gt;";
  
        return $html;
      })
      -&gt;rawColumns(['actions']);
  
      return $datatables-&gt;make(true);
    }
  </code></pre>
  
  <p>-show datatable</p>