/home/techb158/ileadtechnology.com/vendor/laravel/passport/src
NameSizeModeActions
Bridge/-0755rm
Console/-0755rm
Events/-0755rm
Exceptions/-0755rm
Guards/-0755rm
Http/-0755rm
ApiTokenCookieFactory.php21180644editdlrm
AuthCode.php15250644editdlrm
Client.php41790644editdlrm
ClientRepository.php56490644editdlrm
HasApiTokens.php19220644editdlrm
Passport.php159780644editdlrm
PassportServiceProvider.php95320644editdlrm
PassportUserProvider.php18530644editdlrm
PersonalAccessClient.php8680644editdlrm
PersonalAccessTokenFactory.php37140644editdlrm
PersonalAccessTokenResult.php11750644editdlrm
RefreshToken.php18900644editdlrm
RefreshTokenRepository.php16380644editdlrm
RouteRegistrar.php47440644editdlrm
Scope.php11060644editdlrm
Token.php34660644editdlrm
TokenRepository.php29960644editdlrm
TransientToken.php6100644editdlrm
Edit: /home/techb158/ileadtechnology.com/vendor/laravel/passport/src/PersonalAccessTokenFactory.php (3714B)
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 \Laminas\Diactoros\ServerRequest */ protected function createRequest($client, $userId, array $scopes) { $secret = Passport::$hashesClientSecrets ? Passport::$personalAccessClientSecret : $client->secret; return (new ServerRequest)->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 \Laminas\Diactoros\ServerRequest $request * @return array */ protected function dispatchRequestToAuthorizationServer(ServerRequest $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') ); } }