public function checkValidTimes(Carbon $startDate, Carbon $endDate, $throwErrors = true) { if (Carbon::now()->between($startDate, $endDate)) { return true; } else { if ($throwErrors) { throw new CouponException('This coupon has expired'); } else { return false; } } }