title: How to validate Route Parameters in Laravel 5?
body: <p>As you know Laravel 5 changes the way you call the <code>validator</code>, the old way is calling the <code>validator facade</code>, but now there is the <code>ValidatesRequests</code> trait in base Controller class, but the <code>validate</code> method accepts the request as the values array, but when you define your route parameters, these values are not stored in <code>Request</code>, so how can I validate those parameters ? </p>
  
  <p>Edit:</p>
  
  <p>Route:</p>
  
  <pre><code>Route::get('/react-api/{username}', 'ProfileController@getUsername');
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public function getUsername(Request $request, $username)
  {
       $v = $this-&gt;validate($request, ['username' =&gt; 'required']);
  }
  </code></pre>
  
  <p>So, the question how can i validate this username parameter ?</p>