title: Laravel belongsTo / hasMany
body: <p>I`ve a problem and i need to fetch all images ( path ) of my gallery table which own a museum and the user who ownes the museum.
  I get the path of the images but these are not associated to the user_id who owns the museum.</p>
  
  <p>So for short description:</p>
  
  <p>Each user owns a museum and a museum has a gallery with multiple images ( path for the image url )</p>
  
  <p>May table structure</p>
  
  <ul>
  <li>museums
  <ul>
  <li>ID</li>
  <li>title</li>
  <li>user_id</li>
  </ul></li>
  <li>users
  <ul>
  <li>ID</li>
  <li>email</li>
  <li>password</li>
  </ul></li>
  <li>gallery
  <ul>
  <li>ID</li>
  <li>museum_id</li>
  <li>title</li>
  <li>path</li>
  </ul></li>
  </ul>
  
  <p>My Gallery Model:</p>
  
  <pre><code>&lt;?php
  
  class Gallery extends \Eloquent {
  
  protected $fillable = [];
  
  public function museums() {
      //return $this-&gt;belongsToMany('Museums', 'id');
      return $this-&gt;belongsTo('Gallery', 'museum_id');
  }
  }
  </code></pre>
  
  <p>My Museum Model</p>
  
  <pre><code>&lt;?php
  
  class Museum extends Eloquent {
  
  protected $fillable = ['user_id', 'title', 'description'];
  
  public function user()
  {
      return $this-&gt;belongsTo('User');
  }
  
  public function gallery()
  {
      //return $this-&gt;belongsToMany('Gallery', 'museum_id');
      return $this-&gt;belongsToMany('Gallery');
  }
  
  }
  </code></pre>
  
  <p>My User Model</p>
  
  <pre><code>public function museums()
  {
      return $this-&gt;hasMany('Museum');
  }
  </code></pre>
  
  <p>And My MuseumController</p>
  
  <pre><code>public function show($id)
  {
      //
      //$museum = Museum::where('id', '=', $id)-&gt;first();
      //return View::make('museums.detail', compact('museum'));
      $museum = Museum::findOrFail($id);
      $gallery = Gallery::with('museums')-&gt;get();
      //$museum = Museum::with('gallery')-&gt;get();
  
      return View::make('museums.detail', compact('museum', 'gallery'));
  }
  </code></pre>
  
  <p>In my View i have </p>
  
  <pre><code>@foreach ($gallery as $image)
  &lt;img src="{{ $image-&gt;path }}" /&gt;
  @endforeach
  </code></pre>