title: Laravel 4.1: View does not echo query even though controller passes correct json
body: <p>I am following a tutorial on Laravel 4 but I am stuck at a specific point. I want to return a view showing the user with his photos. For this I have the following method in my controller:</p>
  
  <pre><code>    public function show($id)
  {
      $user = User::whereId($id)-&gt;with('photo')-&gt;first();
  
      return View::make('authenticated.users.show', compact('user'));
  }
  </code></pre>
  
  <p>If I return $user the json I am seeing in the browser seems to be perfectly correct.</p>
  
  <p>However, if I try to display that in the show.blade.php view I am getting this error:</p>
  
  <pre><code>Undefined property: Illuminate\Database\Eloquent\Collection::$id
  </code></pre>
  
  <p>The code I am using in my view is the following:</p>
  
  <pre><code> &lt;li&gt;{{ $user-&gt;photo-&gt;id }}&lt;/li&gt;
  </code></pre>
  
  <p>Its exactly as shown in the tutorial but it does not work out.</p>
  
  <p>I would very much appreciate some help.</p>
  
  <p>Thanks.</p>