/home/techb158/dev.balacoffee.com/vendor/laravel/passport/src
NameSizeModeActions
Bridge/-0755rm
Console/-0755rm
Events/-0755rm
Exceptions/-0755rm
Guards/-0755rm
Http/-0755rm
ApiTokenCookieFactory.php21470644editdlrm
AuthCode.php15250644editdlrm
Client.php45380644editdlrm
ClientRepository.php67620644editdlrm
HasApiTokens.php19220644editdlrm
Passport.php168620644editdlrm
PassportServiceProvider.php97280644editdlrm
PassportUserProvider.php18530644editdlrm
PersonalAccessClient.php8680644editdlrm
PersonalAccessTokenFactory.php38930644editdlrm
PersonalAccessTokenResult.php11750644editdlrm
RefreshToken.php18900644editdlrm
RefreshTokenRepository.php16380644editdlrm
RouteRegistrar.php47440644editdlrm
Scope.php11060644editdlrm
Token.php34660644editdlrm
TokenRepository.php29960644editdlrm
TransientToken.php6100644editdlrm
Edit: /home/techb158/dev.balacoffee.com/vendor/laravel/passport/src/PersonalAccessTokenFactory.php (3893B)
jwt = $jwt; $this->tokens = $tokens; $this->server = $server; $this->clients = $clients; } /** * Create a new personal access token. * * @param mixed $userId * @param string $name * @param array $scopes * @return \Laravel\Passport\PersonalAccessTokenResult */ public function make($userId, $name, array $scopes = []) { $response = $this->dispatchRequestToAuthorizationServer( $this->createRequest($this->clients->personalAccessClient(), $userId, $scopes) ); $token = tap($this->findAccessToken($response), function ($token) use ($userId, $name) { $this->tokens->save($token->forceFill([ 'user_id' => $userId, 'name' => $name, ])); }); return new PersonalAccessTokenResult( $response['access_token'], $token ); } /** * Create a request instance for the given client. * * @param \Laravel\Passport\Client $client * @param mixed $userId * @param array $scopes * @return \Psr\Http\Message\ServerRequestInterface */ protected function createRequest($client, $userId, array $scopes) { $secret = Passport::$hashesClientSecrets ? $this->clients->getPersonalAccessClientSecret() : $client->secret; return (new ServerRequest('POST', 'not-important'))->withParsedBody([ 'grant_type' => 'personal_access', 'client_id' => $client->id, 'client_secret' => $secret, 'user_id' => $userId, 'scope' => implode(' ', $scopes), ]); } /** * Dispatch the given request to the authorization server. * * @param \Psr\Http\Message\ServerRequestInterface $request * @return array */ protected function dispatchRequestToAuthorizationServer(ServerRequestInterface $request) { return json_decode($this->server->respondToAccessTokenRequest( $request, new Response )->getBody()->__toString(), true); } /** * Get the access token instance for the parsed response. * * @param array $response * @return \Laravel\Passport\Token */ protected function findAccessToken(array $response) { return $this->tokens->find( $this->jwt->parse($response['access_token'])->claims()->get('jti') ); } }