public function sign(Request $request) : Request
    {
        $algorithmHeader = $this->configuration->getAlgorithmHeader();
        $signatureHeader = $this->configuration->getSignatureHeader();

        $algorithm = $this->configuration->getSigningAlgorithm();
        $key = $this->configuration->getSigningKey();

        $request = $request->withHeader('X-SIGNED-ID', (string) Uuid::uuid4());
        $request = $request->withHeader(
            'X-SIGNED-TIMESTAMP',
            Carbon::now()->format('Y-m-d H:i:s')
        );

        $signature = new Signature(new Payload($request), $algorithm, $key);

        return $request
            ->withHeader($algorithmHeader, (string) $algorithm)
            ->withHeader($signatureHeader, (string) $signature);
    }
public function sign(Request $request) : Request
    {
        $algorithmHeader = $this->configuration->getAlgorithmHeader();
        $signatureHeader = $this->configuration->getSignatureHeader();

        $algorithm = $this->configuration->getSigningAlgorithm();
        $key = $this->configuration->getSigningKey();

        $request = $request->withHeader('X-SIGNED-ID', (string) Uuid::uuid4());
        $request = $request->withHeader(
            'X-SIGNED-TIMESTAMP',
            Carbon::now()->format('Y-m-d H:i:s')
        );

        $signature = new Signature(new Payload($request), $algorithm, $key);

        return $request
            ->withHeader($algorithmHeader, (string) $algorithm)
            ->withHeader($signatureHeader, (string) $signature);
    }
public function sign ( Request $ request ) : Request { $ algorithmHeader = $ this -> configuration -> getAlgorithmHeader ( ) ; $ signatureHeader = $ this -> configuration -> getSignatureHeader ( ) ; $ algorithm = $ this -> configuration -> getSigningAlgorithm ( ) ; $ key = $ this -> configuration -> getSigningKey ( ) ; $ request = $ request -> withHeader ( 'X-SIGNED-ID' , ( string ) Uuid :: uuid4 ( ) ) ; $ request = $ request -> withHeader ( 'X-SIGNED-TIMESTAMP' , Carbon :: now ( ) -> format ( 'Y-m-d H:i:s' ) ) ; $ signature = new Signature ( new Payload ( $ request ) , $ algorithm , $ key ) ; return $ request -> withHeader ( $ algorithmHeader , ( string ) $ algorithm ) -> withHeader ( $ signatureHeader , ( string ) $ signature ) ; }
Signs and returns the request.

@param \GuzzleHttp\Psr7\Request $request
The request to sign.

@return \GuzzleHttp\Psr7\Request
The request with an id, algorithm, and signature.
Signs and returns the request .