<?php


namespace MtcPharmacy\Subscriptions\Classes;
use Illuminate\Database\Eloquent\Model;

class SubscriptionCancellation extends Model
{
    protected $table = 'subscription_cancellations';

    protected $fillable = ['reason', 'reason_description'];

    public function subscription()
    {
        return $this->belongsTo(Subscription::class);
    }

    public function getReasonTextAttribute()
    {
        return Subscription::CANCELLATION_REASONS[$this->reason] ?? $this->reason;
    }
}