This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
site-base/spark/src/Subscription.php

27 lines
558 B
PHP
Raw Normal View History

2017-11-03 05:26:07 +00:00
<?php
namespace Laravel\Spark;
use Laravel\Cashier\Subscription as CashierSubscription;
class Subscription extends CashierSubscription
{
/**
* The accessors to append to the model's array form.
*
* @var array
*/
protected $appends = ['provider_plan'];
/**
* Get the "provider_plan" attribute from the model.
*
* @return string
*/
public function getProviderPlanAttribute()
{
return Spark::billsUsingStripe()
? $this->stripe_plan : $this->braintree_plan;
}
}