src/PersonalAccessTokenFactory.php
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
        );
    }
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
        );
    }
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 new personal access token.

@param  mixed  $userId
@param  string  $name
@param  array  $scopes
@return \Laravel\Passport\PersonalAccessTokenResult
Create a new personal access token .