Merhabalar,
Bir routes/api.php üzerinde bir yetkilendirme işlemi için route tanımladım. Tüm değerleri doğru girdiğimi düşünüyorum. Fakat 500 hatası veriyor. Sorun nerede, yardım eder misiniz?
use Illuminate\Http\Request;
Route::post('/token', function(Request $request) {
$client = (new Laravel\Passport\Client)->find(2);
$http = new GuzzleHttp\Client;
$response = $http->post(config('app.url').'/oauth/token', [
'form_params' => [
'grant_type' => 'password',
'client_id' => $client->id,
'client_secret' => $client->secret,
'username' => $request->username,
'password' => $request->password,
'scope' => '',
],
'timeout' => 5,
]);
return json_decode((string) $response->getBody(), true);
});