title: Laravel belongs to Many relations
body: <p>I can't speak English well. I'm Sorry.</p>
  <p>There are 3 tables : adverts, advert_categories, categories.</p>
  <p>I want to pull data, I get an error
  <a href="https://i.stack.imgur.com/EPDqZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EPDqZ.png" alt="error" /></a></p>
  <pre><code>Adverts::with(['categories'])-&gt;where(&quot;user_id&quot;, Auth::user()-&gt;id)-&gt;get();
  </code></pre>
  <pre><code>public function categories(){
          return $this-&gt;belongsToMany(AdvertCategories::class, 'advert_categories', 'advert_id', 'category_id');
      }
  </code></pre>
  <p><strong>advert_categories :</strong></p>
  <p><a href="https://i.stack.imgur.com/ZQQiQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZQQiQ.png" alt="advert_categories" /></a></p>
  <p><strong>categories:</strong></p>
  <p><a href="https://i.stack.imgur.com/XgEXC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XgEXC.png" alt="enter image description here" /></a></p>