title: How to Join same table in laravel
body: <p>I wan to wirte a join query to connect same table, and without <code>ON</code>, but when i write it in laravel without on it is showing error</p>
  
  <pre><code>$key = DB::table('api_keys as ak')  
  -&gt;join('api_keys as bk','') 
                -&gt;where('ak.api_key', $api_key)-&gt;where('ak.user_id',0)
                -&gt;pluck('api_key');
  </code></pre>
  
  <p>want to build the below query,</p>
  
  <pre><code>SELECT * FROM `api_keys` as ak
    JOIN `api_keys` as bk
   WHERE ak.`api_key`=$akey
     and ak.`user_id`=$auser
     and bk.`user_id`=$bsuer
     and bk.`api_key`=$bkey 
  </code></pre>