'int', 'payment_option_id' => 'int', 'coupon_id' => 'int', 'valid_until_date' => 'datetime', 'next_due_date' => 'datetime' ]; protected $fillable = [ 'user_id', 'payment_option_id', 'coupon_id', 'status', 'valid_until_date', 'next_due_date' ]; public function coupon() { return $this->belongsTo(Coupon::class); } public function payment_option() { return $this->belongsTo(PaymentOption::class); } public function sf_guard_user() { return $this->belongsTo(SfGuardUser::class, 'user_id'); } public function user_payments() { return $this->hasMany(UserPayment::class); } public function companies() { return $this->belongsToMany(Company::class, 'user_payment_option_company', 'payment_option_id') ->withPivot('ip_address', 'is_active') ->withTimestamps(); } public function user_payment_option_reference() { return $this->hasOne(UserPaymentOptionReference::class, 'parent_user_payment_option_id'); } }