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;
            }
        }
    }
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;
            }
        }
    }
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 ; } } }
Checks to see if the times are valid for the coupon.

@param Carbon $startDate
@param Carbon $endDate
@param $throwErrors

@throws CouponException

@return bool
Checks to see if the times are valid for the coupon .