public function maxDiscount($maxDiscount, $discount, $throwErrors = true)
    {
        if ($maxDiscount == 0 || $maxDiscount > $discount) {
            return $discount;
        } else {
            if ($throwErrors) {
                throw new CouponException('This has a max discount of '.\App::make(\LukePOLO\Laracart\LaraCart::SERVICE)->formatMoney($maxDiscount));
            } else {
                return $maxDiscount;
            }
        }
    }
public function maxDiscount($maxDiscount, $discount, $throwErrors = true)
    {
        if ($maxDiscount == 0 || $maxDiscount > $discount) {
            return $discount;
        } else {
            if ($throwErrors) {
                throw new CouponException('This has a max discount of '.\App::make(\LukePOLO\Laracart\LaraCart::SERVICE)->formatMoney($maxDiscount));
            } else {
                return $maxDiscount;
            }
        }
    }
public function maxDiscount ( $ maxDiscount , $ discount , $ throwErrors = true ) { if ( $ maxDiscount == 0 || $ maxDiscount > $ discount ) { return $ discount ; } else { if ( $ throwErrors ) { throw new CouponException ( 'This has a max discount of ' . \ App :: make ( \ LukePOLO \ Laracart \ LaraCart :: SERVICE ) -> formatMoney ( $ maxDiscount ) ) ; } else { return $ maxDiscount ; } } }
Returns either the max discount or the discount applied based on what is passed through.

@param $maxDiscount
@param $discount
@param $throwErrors

@throws CouponException

@return mixed
Returns either the max discount or the discount applied based on what is passed through .