title: Laravel Auth check if url is equal to User Logged In
body: <p>Hello so I've started using Laravel 5 and found it very useful. For now I am on the Auth part. What I want to do is the equivalent of this code in laravel:</p>
  
  <pre><code>if($_SESSION['user'] == $_GET['user'])
  {
   // I can only see this page
  }
  </code></pre>
  
  <p>This is what my function in my controller looks like:</p>
  
  <pre><code>public function viewProfile(User $user)
  {
      $cur_user = \Auth::user()-&gt;username;
      return view('profile', compact('user', 'cur_user'));
  }
  </code></pre>
  
  <p>And the url for example is like this <code>http://localhost:8000/profile/sorxrob</code>. The <code>sorxrob</code> there is the username. How can I do <code>Auth::user()</code> == Get url in laravel?</p>