⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.142
Server IP:
217.76.53.76
Server:
Linux vmi1397931.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
Server Software:
Apache
PHP Version:
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
mydetails.com.ng
/
app
/
Models
/
View File Name :
Subscription.php
'Stripe', self::PAYPAL => 'Paypal', self::RAZORPAY => 'Razorpay', self::MANUALLY => 'Manually', ]; const PAYMENT_TYPES = [ self::TYPE_FREE => 'Free Plan', self::TYPE_STRIPE => 'Stripe', self::TYPE_PAYPAL => 'PayPal', self::TYPE_RAZORPAY => 'RazorPay', ]; const TYPE = [ 'stripe' => 'Stripe', 'paypal' => 'PayPal', 'razorpay' => 'RazorPay', 'manually' => 'Manually', ]; const ACTIVE = 1; const INACTIVE = 0; const PENDING = 2; const REJECT = 3; const STATUS_ARR = [ self::ACTIVE => 'Active', self::INACTIVE => 'Deactive', self::PENDING => 'Pending', self::REJECT => 'Reject', ]; const MONTH = 'Month'; const YEAR = 'Year'; public const ATTACHMENT_PATH = 'attachment'; public const NOTES_PATH = 'notes'; protected $appends = ['attachment']; /** * @var array */ protected $fillable = [ 'tenant_id', 'plan_id', 'transaction_id', 'plan_amount', 'discount', 'payable_amount', 'plan_frequency', 'starts_at', 'ends_at', 'trial_ends_at', 'status', 'coupon_code_meta', 'no_of_vcards', 'notes', 'payment_type', ]; public function getAttachmentAttribute(): string { /** @var Media $media */ $media = $this->getMedia(self::ATTACHMENT_PATH)->first(); if (! empty($media)) { return $media->getFullUrl(); } return false; } protected $casts = [ 'tenant_id' => 'string', 'plan_id' => 'integer', 'transaction_id' => 'integer', 'plan_amount' => 'double', 'discount' => 'double', 'payable_amount' => 'double', 'plan_frequency' => 'integer', 'starts_at' => 'datetime', 'ends_at' => 'datetime', 'trial_ends_at' => 'datetime', 'status' => 'integer', 'coupon_code_meta' => 'json', 'no_of_vcards' => 'double', 'payment_type' => 'string', ]; public function plan(): BelongsTo { return $this->belongsTo(Plan::class, 'plan_id'); } public function isExpired(): bool { $now = Carbon::now(); if ($this->ends_at > $now) { return false; } // this means the subscription is ended. if ((! empty($this->trial_ends_at) && $this->trial_ends_at < $now) || $this->ends_at < $now) { return true; } // this means the subscription is not ended. return false; } public function transactions(): HasOne { return $this->hasOne(Transaction::class, 'transaction_id', 'id'); } public function users(): BelongsTo { return $this->belongsTo(Subscription::class); } }