src/Token.php
public static function create($userId, string $secret, int $expiration, string $issuer): string
    {
        $builder = self::builder();

        return $builder->setPayloadClaim('user_id', $userId)
            ->setSecret($secret)
            ->setExpiration($expiration)
            ->setIssuer($issuer)
            ->setIssuedAt(time())
            ->build()
            ->getToken();
    }
public static function create($userId, string $secret, int $expiration, string $issuer): string
    {
        $builder = self::builder();

        return $builder->setPayloadClaim('user_id', $userId)
            ->setSecret($secret)
            ->setExpiration($expiration)
            ->setIssuer($issuer)
            ->setIssuedAt(time())
            ->build()
            ->getToken();
    }
public static function create ( $ userId , string $ secret , int $ expiration , string $ issuer ) : string { $ builder = self :: builder ( ) ; return $ builder -> setPayloadClaim ( 'user_id' , $ userId ) -> setSecret ( $ secret ) -> setExpiration ( $ expiration ) -> setIssuer ( $ issuer ) -> setIssuedAt ( time ( ) ) -> build ( ) -> getToken ( ) ; }
Create a JSON Web Token that contains a user identifier and a basic
payload including issued at, expiration and issuer.

@param mixed $userId
@param string $secret
@param int $expiration
@param string $issuer

@return string
Create a JSON Web Token that contains a user identifier and a basic payload including issued at expiration and issuer .