title: Selecting Records depending on two IDs
body: <p>This is kinda complicated, but  whatever..
  Okay I have four Tables </p>
  
  <pre><code>1-Projects 
  
   id     | int 11
   name 
  2-Sections
  
   id         | int 11
   project_id | int 11
   name
  3-Users
  
   id         | int 11
  
  4-User_Section_project (this table is used to assign users to sections they will work on in the project
  
  id         | int 11
  project_id | int 11
  section_id | int 11
  user_id    | int 11
  </code></pre>
  
  <p>Is there anyway using ORM to make something like that works and I get only the assigned sections </p>
  
  <pre><code>$sections = $user-&gt;projects()-&gt;sections()
  </code></pre>
  
  <p>I made it out using the following code in my User model</p>
  
  <pre><code> public function workshops()
  {
  
  
      return $this-&gt;belongsToMany('section', 'user_project_section', 'user_id', 'section_id')-&gt;whereIn('user_project_section.project_id', array(1,2,3));
  }
  </code></pre>
  
  <p>And I call it like that</p>
  
  <pre><code>@foreach ( $user-&gt;sections as $section)
                      {{$section-&gt;name}}
  
                  @endforeach
  </code></pre>
  
  <p>This code will get the associated Sections for the users in Projects 1,2,3. 
  If i want to make it for a specified project, I pass a parameter the problem is when adding parentheses ()  to the call of the function in the view it doesn't work so I can't pass a parameter</p>
  
  <pre><code>@foreach ( $user-&gt;sections() as $section)
                      {{$section-&gt;name}}
  
                  @endforeach
  </code></pre>
  
  <p>What makes it worse there is no error msg pops up and monitoring my Mysql Server Queries , This is not queried (executed) at all.
  I really Need that to pass a parameter
  More Info : 
  Using Print_r it appears that without () it returns Collection Object , with-it it returns BelongsToMany Object.</p>