title: Laravel 5 - How to get Auth user ID in controller, retrieve user data and display that data in view
body: <p>New to the Laravel 5 framework (and OOP), I want to create a view where a user can view/edit his own user profile when he's logged in.</p>
  
  <p>What would be the syntax to get Auth user ID in controller, retrieve user data (from DB) and display that data in the profile view.</p>
  
  <p>I tried the following, but doesn't work.</p>
  
  <p>Controller:</p>
  
  <pre><code>/**
   * Show the application user profile to the user.
   *
   * @return Response
   */
  public function profile()
  {
  
      $users = User::find(Auth::user()-&gt;id);
  
      return view('profile')-&gt;with(['users' =&gt; $users]);
  }
  </code></pre>
  
  <p>Profile view:</p>
  
  <pre><code>&lt;div class="row"&gt;
      &lt;div class="col-md-10 col-md-offset-1"&gt;
          &lt;div class="panel panel-default"&gt;
              &lt;div class="panel-heading"&gt;Profil&lt;/div&gt;
  
              &lt;div class="panel-body"&gt;
                  Your user id is: {{ Auth::user()-&gt;id }}.
  
      &lt;table&gt;
  @foreach($users as $user)
      &lt;tr&gt;
          &lt;td&gt;{{ $user-&gt;first_name }}&lt;/td&gt;
          &lt;td&gt;{{ $user-&gt;last_name }}&lt;/td&gt;
  
      &lt;/tr&gt;
  @endforeach
      &lt;/table&gt;
  
  
  
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Thanks. Any help would be greatly appreciated</p>