title: How to use joins in Lumen
body: <p>I have this query:</p>
  
  <pre><code>SELECT fname, gender FROM users, speciality WHERE users.id = userSpeciality.user_id AND type = 2
  </code></pre>
  
  <p>I want the same query in Lumen. I have tried something like this but it doesnt work:</p>
  
  <pre><code>$users   = Speciality::join('users', 'users.id', '=', 'speciality.user_id')
             -&gt;where('type' =&gt; 2)
             -&gt;select('fname', 'gender')
             -&gt;get();
  </code></pre>
  
  <p>Table : <code>speciality</code> is the main table here. Which contains user ids.</p>