I have set up a new laravel 5.6 install with Laravel Passport install. If I make a post request to http://127.0.0.1/oauth/token with Postman I get a valid token back:
<This is because the built-in PHP server is single threaded. Hence your second (internal) request to the OAuth server is killing the first one.
See my comment here.
I have also tried to generate the token from curl or guzzle. try to use this code it works for me.
function tokenRequest(Request $request){
$request->request->add([
"grant_type" => "password",
"username" => $request->username,
"password" => $request->password,
"client_id" => "2",
"client_secret" => "VE5S97DfjNciEWJOL1gEZhVLEx2VAGJQEX1dK6cq",
]);
$tokenRequest = $request->create(
env('APP_URL').'/oauth/token',
'post'
);
$instance = Route::dispatch($tokenRequest);
return json_decode($instance->getContent());
}