where('coupon_id', $this->id)->exists()) { return 1; } } return 0; } public function couponType (){ return $this->hasMany(CouponType::class); } }