PHP Класс Laravel\Cashier\Subscription

Наследование: extends Illuminate\Database\Eloquent\Model
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$dates array The attributes that should be mutated to dates.
$guarded array The attributes that aren't mass assignable.

Открытые методы

Метод Описание
active ( ) : boolean Determine if the subscription is active.
applyCoupon ( $coupon, $removeOthers = false ) * Apply a coupon to the subscription.
asBraintreeSubscription ( ) : Braintree\Subscription Get the subscription as a Braintree subscription object.
cancel ( ) Cancel the subscription.
cancelNow ( ) Cancel the subscription immediately.
cancelled ( ) : boolean Determine if the subscription is no longer active.
markAsCancelled ( ) : void Mark the subscription as cancelled.
onGracePeriod ( ) : boolean Determine if the subscription is within its grace period after cancellation.
onTrial ( ) : boolean Determine if the subscription is within its trial period.
resume ( ) Resume the cancelled subscription.
swap ( string $plan ) Swap the subscription to a new Braintree plan.
user ( ) Get the user that owns the subscription.
valid ( ) : boolean Determine if the subscription is active, on trial, or within its grace period.

Защищенные методы

Метод Описание
currentDiscounts ( ) : array Get the current discounts for the subscription.
getDiscountForSwitchToMonthly ( BraintreePlan $currentPlan, BraintreePlan $plan ) : object Get the discount to apply when switching to a monthly plan.
getDiscountForSwitchToYearly ( ) : object Get the discount to apply when switching to a yearly plan.
moneyRemainingOnYearlyPlan ( BraintreePlan $plan ) : float Calculate the amount of discount to apply to a swap to monthly billing.
swapAcrossFrequencies ( string $plan ) Swap the subscription to a new Braintree plan with a different frequency.
switchingToMonthlyPlan ( BraintreePlan $currentPlan, BraintreePlan $plan ) : boolean Determine if the user is switching form yearly to monthly billing.
wouldChangeBillingFrequency ( string $plan ) : boolean Determine if the given plan would alter the billing frequency.

Описание методов

active() публичный Метод

Determine if the subscription is active.
public active ( ) : boolean
Результат boolean

applyCoupon() публичный Метод

* Apply a coupon to the subscription.
public applyCoupon ( $coupon, $removeOthers = false )
$coupon
$removeOthers

asBraintreeSubscription() публичный Метод

Get the subscription as a Braintree subscription object.
public asBraintreeSubscription ( ) : Braintree\Subscription
Результат Braintree\Subscription

cancel() публичный Метод

Cancel the subscription.
public cancel ( )

cancelNow() публичный Метод

Cancel the subscription immediately.
public cancelNow ( )

cancelled() публичный Метод

Determine if the subscription is no longer active.
public cancelled ( ) : boolean
Результат boolean

currentDiscounts() защищенный Метод

Get the current discounts for the subscription.
protected currentDiscounts ( ) : array
Результат array

getDiscountForSwitchToMonthly() защищенный Метод

Get the discount to apply when switching to a monthly plan.
protected getDiscountForSwitchToMonthly ( BraintreePlan $currentPlan, BraintreePlan $plan ) : object
$currentPlan BraintreePlan
$plan BraintreePlan
Результат object

getDiscountForSwitchToYearly() защищенный Метод

Get the discount to apply when switching to a yearly plan.
protected getDiscountForSwitchToYearly ( ) : object
Результат object

markAsCancelled() публичный Метод

Mark the subscription as cancelled.
public markAsCancelled ( ) : void
Результат void

moneyRemainingOnYearlyPlan() защищенный Метод

Calculate the amount of discount to apply to a swap to monthly billing.
protected moneyRemainingOnYearlyPlan ( BraintreePlan $plan ) : float
$plan BraintreePlan
Результат float

onGracePeriod() публичный Метод

Determine if the subscription is within its grace period after cancellation.
public onGracePeriod ( ) : boolean
Результат boolean

onTrial() публичный Метод

Determine if the subscription is within its trial period.
public onTrial ( ) : boolean
Результат boolean

resume() публичный Метод

Resume the cancelled subscription.
public resume ( )

swap() публичный Метод

Swap the subscription to a new Braintree plan.
public swap ( string $plan )
$plan string

swapAcrossFrequencies() защищенный Метод

Swap the subscription to a new Braintree plan with a different frequency.
protected swapAcrossFrequencies ( string $plan )
$plan string

switchingToMonthlyPlan() защищенный Метод

Determine if the user is switching form yearly to monthly billing.
protected switchingToMonthlyPlan ( BraintreePlan $currentPlan, BraintreePlan $plan ) : boolean
$currentPlan BraintreePlan
$plan BraintreePlan
Результат boolean

user() публичный Метод

Get the user that owns the subscription.
public user ( )

valid() публичный Метод

Determine if the subscription is active, on trial, or within its grace period.
public valid ( ) : boolean
Результат boolean

wouldChangeBillingFrequency() защищенный Метод

Determine if the given plan would alter the billing frequency.
protected wouldChangeBillingFrequency ( string $plan ) : boolean
$plan string
Результат boolean

Описание свойств

$dates защищенное свойство

The attributes that should be mutated to dates.
protected array $dates
Результат array

$guarded защищенное свойство

The attributes that aren't mass assignable.
protected array $guarded
Результат array