title: How to check if one record is attached to another?
body: <p>I have defined a many-to-many relationship between <code>Student</code> and <code>Seminar</code> models. How can I find out if <strong>one particular student</strong> is attending <strong>one particular seminar</strong>? Non-working example of what I want to achieve is illustrated below:</p>
  
  <pre><code>$seminar-&gt;students()-&gt;contains($student-&gt;id);
  </code></pre>
  
  <p>The following error is shown when using the above code snippet:</p>
  
  <blockquote>
    <p>BadMethodCallException with message 'Call to undefined method Illuminate\Database\Query\Builder::contain()'</p>
  </blockquote>