title: Getting multiple relationships in Eloquent
body: <p><a href="https://stackoverflow.com/questions/35973670/fundamental-misunderstanding-of-model-in-eloquent-outside-of-laravel?noredirect=1#comment59603216_35973670">Fundamental misunderstanding of model in Eloquent (Outside of Laravel)</a></p>
  
  <p>My previous question that ceejayoz helped point me in the right direction for, but that has led me to what is basically a new question.</p>
  
  <p>I'm working on a simple chemical tracking database and have it structured with a chemicals table which tracks most of the info but I have a few fields that started out as Enums but I realized that would not work for.  There are now separate tables for company, room, and location.  All of these additional tables include just an id and the field so company is:</p>
  
  <p>1 | 'FISHER'</p>
  
  <p>2 | 'BDH' </p>
  
  <p>etc.</p>
  
  <p>I can do </p>
  
  <pre><code>$company = chemical::find(4)-&gt;company;
  </code></pre>
  
  <p>for example and that will give me the name of the company for that chemical, but what I am trying to do is display a table with all of the information in each chemical, as well as the associated company name, room, location.
  I am just not sure as to how to accomplish this.  </p>
  
  <p>How would I even get the associated company for all the chemicals?</p>
  
  <pre><code>$chemicals = company::all()-&gt;company;
  </code></pre>
  
  <p>Does not work and I can see why.</p>
  
  <pre><code>$chemicals = chemical::all();   
  
  foreach($chemicals as $chem) {
      echo $chem-&gt;company . "&lt;br /&gt;";
  }  
  </code></pre>
  
  <p>Will get me the associated companies and that's great, but then where do I go from there in terms of the comprehensive table?</p>