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