protected function getSeconds($ttl)
    {
        $duration = $this->parseDateInterval($ttl);

        if ($duration instanceof DateTimeInterface) {
            $duration = Carbon::now()->diffInRealSeconds($duration, false);
        }

        return (int) $duration > 0 ? $duration : 0;
    }
protected function getSeconds($ttl)
    {
        $duration = $this->parseDateInterval($ttl);

        if ($duration instanceof DateTimeInterface) {
            $duration = Carbon::now()->diffInRealSeconds($duration, false);
        }

        return (int) $duration > 0 ? $duration : 0;
    }
protected function getSeconds ( $ ttl ) { $ duration = $ this -> parseDateInterval ( $ ttl ) ; if ( $ duration instanceof DateTimeInterface ) { $ duration = Carbon :: now ( ) -> diffInRealSeconds ( $ duration , false ) ; } return ( int ) $ duration > 0 ? $ duration : 0 ; }
Calculate the number of seconds for the given TTL.

@param  \DateTimeInterface|\DateInterval|int  $ttl
@return int
Calculate the number of seconds for the given TTL .