public function onTrial(string $subscription = 'default', ?string $plan = null): bool
    {
        if (func_num_args() === 0 && $this->onGenericTrial()) {
            return true;
        }
        $subscription = $this->subscription($subscription);
        if (is_null($plan)) {
            return $subscription && $subscription->onTrial();
        }

        return $subscription && $subscription->onTrial() &&
            $subscription->stripePlan === $plan;
    }
public function onTrial(string $subscription = 'default', ?string $plan = null): bool
    {
        if (func_num_args() === 0 && $this->onGenericTrial()) {
            return true;
        }
        $subscription = $this->subscription($subscription);
        if (is_null($plan)) {
            return $subscription && $subscription->onTrial();
        }

        return $subscription && $subscription->onTrial() &&
            $subscription->stripePlan === $plan;
    }
public function onTrial ( string $ subscription = 'default' , ? string $ plan = null ) : bool { if ( func_num_args ( ) === 0 && $ this -> onGenericTrial ( ) ) { return true ; } $ subscription = $ this -> subscription ( $ subscription ) ; if ( is_null ( $ plan ) ) { return $ subscription && $ subscription -> onTrial ( ) ; } return $ subscription && $ subscription -> onTrial ( ) && $ subscription -> stripePlan === $ plan ; }
Determine if the user is on trial.

@param string $subscription
@param string|null $plan

@return bool
Determine if the user is on trial .