protected function getExpirationTimestamp($expiration)
    {
        if (is_int($expiration)) {
            $expiration = (new DateTime())->modify((int) $expiration.' days');
        }

        if (!$expiration instanceof DateTime) {
            throw new InvalidExpiration('Expiration date must be an instance of DateTime or an integer');
        }

        if (!$this->isFuture($expiration->getTimestamp())) {
            throw new InvalidExpiration('Expiration date must be in the future');
        }

        return (string) $expiration->getTimestamp();
    }
protected function getExpirationTimestamp($expiration)
    {
        if (is_int($expiration)) {
            $expiration = (new DateTime())->modify((int) $expiration.' days');
        }

        if (!$expiration instanceof DateTime) {
            throw new InvalidExpiration('Expiration date must be an instance of DateTime or an integer');
        }

        if (!$this->isFuture($expiration->getTimestamp())) {
            throw new InvalidExpiration('Expiration date must be in the future');
        }

        return (string) $expiration->getTimestamp();
    }
protected function getExpirationTimestamp ( $ expiration ) { if ( is_int ( $ expiration ) ) { $ expiration = ( new DateTime ( ) ) -> modify ( ( int ) $ expiration . ' days' ) ; } if ( ! $ expiration instanceof DateTime ) { throw new InvalidExpiration ( 'Expiration date must be an instance of DateTime or an integer' ) ; } if ( ! $ this -> isFuture ( $ expiration -> getTimestamp ( ) ) ) { throw new InvalidExpiration ( 'Expiration date must be in the future' ) ; } return ( string ) $ expiration -> getTimestamp ( ) ; }
Retrieve the expiration timestamp for a link based on an absolute DateTime or a relative number of days.

@param \DateTime|int $expiration The expiration date of this link.
- DateTime: The value will be used as expiration date
- int: The expiration time will be set to X days from now

@throws \Spatie\UrlSigner\Exceptions\InvalidExpiration

@return string
Retrieve the expiration timestamp for a link based on an absolute DateTime or a relative number of days .