mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-07-31 05:16:49 -04:00
69 lines
1.7 KiB
PHP
69 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace Modules\Subscription\Entities;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Modules\Product\Entities\Product;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class SubscriptionPlanPrice extends Model
|
|
{
|
|
|
|
use SoftDeletes;
|
|
protected $dates = ['deleted_at'];
|
|
|
|
protected $table = 'subscription_plan_prices';
|
|
protected $guarded = ['id'];
|
|
protected $fillable = [
|
|
'subscription_plan_id',
|
|
'price',
|
|
'days',
|
|
'billing_type',
|
|
'access',
|
|
'access_expire_duration',
|
|
'access_expire_duration_type',
|
|
'access_expire_on',
|
|
'interval',
|
|
'custom_interval',
|
|
'custom_interval_type',
|
|
'trial_period',
|
|
'limit_payment_cycles',
|
|
'trial_duration',
|
|
'trial_amount',
|
|
'allow_only_one_trial',
|
|
'max_number_of_payments',
|
|
'access_after_last_cycle',
|
|
'access_expire_duration_after_last_cycle',
|
|
'access_expire_duration_type_after_last_cycle',
|
|
'stripe_price_id',
|
|
'paypal_price_id',
|
|
'payment',
|
|
'payment_method',
|
|
'available',
|
|
'total_credits',
|
|
'per_month_credits',
|
|
];
|
|
|
|
protected $casts = [
|
|
'price' => 'double',
|
|
'trial_amount' => 'double',
|
|
'available' => 'boolean',
|
|
'total_credits' => 'integer',
|
|
'per_month_credits' => 'integer',
|
|
];
|
|
|
|
public function plan() {
|
|
return $this->belongsTo(SubscriptionPlan::class, 'subscription_plan_id');
|
|
}
|
|
|
|
public function getPaymentMethodAttribute($value)
|
|
{
|
|
return explode (",", $value);
|
|
}
|
|
|
|
public function setPaymentMethodAttribute($value)
|
|
{
|
|
$this->attributes['payment_method'] = implode(',', $value);
|
|
}
|
|
}
|