i'm creating an authentication api using passport from the official docs but i'm stuck on sending GuzzelHttp request
i'v done exactly like the docs but when i want to test with postman no result returned it just stay loading without end
this is my code my controller
$user = new User();
$user->email = $request->email;
$user->name = $request->name;
$user->password = bcrypt($request->password);
$user->save();
$http = new Client;
$response = $http->post('http://localhost:8000/oauth/token', [
'form_params' => [
'grant_type' => 'password',
'client_id' => 2,
'client_secret' => 'x2ESrkADoQEaQ91iMW9kKiIvjKo0LL4RxlUtqtmy',
'password' => $request->password
],
]);
dd($response);
return response([
'success'=> true,
'successMessageKey' => 'userCreatedSuccessfully' ,
'data'=>json_decode((string) $response->getBody(), true)
]);
and my route
Route::post('users/register',[
'uses' => 'Api\AuthController@register'
]);
and when i run my route i got no result like this and stuck in loading