title: foreach the data of relationship
body: <p>I have two tables <code>media_user</code> and <code>users</code></p>
  
  <p>media_user table like <strong>[ id | user_id | media_id | link ]</strong></p>
  
  <p>I need to bring all user from <code>media_user</code> by relationship, so I created relation in user model:</p>
  
  <pre><code>/**
  * that users belong to the media_user table.
  */
  
  public function media()
  {
      return $this-&gt;hasMany('App\Models\Social_Media','user_id','id');
  }
  </code></pre>
  
  <p>And in the view, I did this</p>
  
  <pre><code> @foreach ($user-&gt;media as $m)
  
     // my data
  
   @endforeach
  </code></pre>
  
  <p>I got the empty array when I dump the result as <code>dd($user-&gt;media)</code></p>
  
  <p>What is the problem pls?</p>