title: Laravel 5 Throw an exception: BadMethodCallException with message 'Call to undefined method Illuminate\Database\Query\Builder::tags()
body: <p>I'm using Laravel 5, and I'm a bit new to this framework. I searched a lot for the problem, but in return I got nothing related.</p>
  
  <p>So, I have two models:
  Article and Tag.</p>
  
  <p>In Article Model I have a method like this:</p>
  
  <pre><code>public function tags() {
      return $this-&gt;belongsToMany("App\Tag");
  }
  </code></pre>
  
  <p>And in my Tag Model I have a method like this:</p>
  
  <pre><code>public function articles() {
      return $this-&gt;belongsToMany("App\Article");
  }
  </code></pre>
  
  <p>Now the thing is that when I'm testing this in tinker like this:</p>
  
  <pre><code>$article-&gt;tags()-&gt;attach(1);
  </code></pre>
  
  <p>It gives me the following Exception:</p>
  
  <blockquote>
    <p>BadMethodCallException with message 'Call to undefined method Illuminate\Database\Query\Builder::tags()'</p>
  </blockquote>
  
  <p>But when I'm calling it like this:</p>
  
  <pre><code>$tag-&gt;articles()-&gt;attach(1);
  </code></pre>
  
  <p>It totally works like a charm and It doesn't throw any kind of Exception whatsoever.</p>
  
  <p>I'm actually learning this stuff from Laracast and my Classes and methods and files are kind of like this:
  <a href="https://stackoverflow.com/questions/34624946/badmethodcallexception-with-message-call-to-undefined-method-illuminate-databas">BadMethodCallException with message &#39;Call to undefined method Illuminate\Database\Query\Builder::belongToMany()&#39;</a></p>
  
  <p>Except I think I don't have a typo problem.</p>