title: Laravel 5 - Undefined property when using relationships
body: <p>I started with a basic query which returned project data from a table:</p>
  
  <pre><code>$project = Project::find($id);
  return view('project.show')-&gt;with('project', $project);
  </code></pre>
  
  <p>And then on my page I <code>dd()</code>'d the <code>$project-&gt;id</code> and it worked.</p>
  
  <p>I also now have a table called user.</p>
  
  <p>A project belongs to a user, so I have a relationship set up in my model:</p>
  
  <pre><code>public function user()
  {
      return $this-&gt;belongsTo('App\User');
  }
  </code></pre>
  
  <p>And I then do:</p>
  
  <pre><code>$project = Project::with('user')-&gt;where('id', $id)-&gt;get();
  </code></pre>
  
  <p>But I get the error:</p>
  
  <blockquote>
    <p>Undefined property: Illuminate\Database\Eloquent\Collection::$id</p>
  </blockquote>
  
  <p>If I just <code>dd()</code> the <code>$project</code>:</p>
  
  <pre><code>Collection {#200 ▼
      #items: array:1 [▼
      0 =&gt; Project {#196 ▼
        #fillable: array:1 [▶]
        #dates: array:2 [▶]
        #connection: null
        #table: null
        #primaryKey: "id"
        #perPage: 15
        +incrementing: true
        +timestamps: true
        #attributes: array:5 [▶]
        #original: array:5 [▶]
        #relations: array:1 [▶]
        #hidden: []
        #visible: []
        #appends: []
        #guarded: array:1 [▶]
        #dateFormat: null
        #casts: []
        #touches: []
        #observables: []
        #with: []
        #morphClass: null
        +exists: true
        +wasRecentlyCreated: false
      }
      ]
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>To clarify, I want to be able to do:</p>
  
  <pre><code>$project-&gt;id
  $project-&gt;user-&gt;name
  </code></pre>