54 lines
1.1 KiB
PHP
54 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Subscriptions extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'subscriptions';
|
|
protected $guarded = [];
|
|
|
|
public function subscription()
|
|
{
|
|
return $this->belongsTo(IamPrincipal::class, 'iam_principal_xid', 'id');
|
|
}
|
|
|
|
|
|
protected $fillable = [
|
|
'id',
|
|
'subscription_product_xid',
|
|
'iam_principal_xid',
|
|
'amount',
|
|
'stripe_customer_id',
|
|
'payment_intent_id',
|
|
'payment_intent_client_secret',
|
|
'subscription_id',
|
|
'subscription_status',
|
|
'current_period_start',
|
|
'current_period_end',
|
|
'status',
|
|
'next_payment_date',
|
|
'is_cancelled_subscription',
|
|
'cancelled_at',
|
|
'is_active',
|
|
'deleted_at',
|
|
'created_by',
|
|
'modified_by',
|
|
'created_at',
|
|
'updated_at'
|
|
];
|
|
|
|
|
|
public function iamPrincipal()
|
|
{
|
|
return $this->belongsTo(IamPrincipal::class, 'iam_principal_xid', 'id');
|
|
}
|
|
|
|
}
|
|
|
|
|