Skip to content

Commit

Permalink
Merge branch '0.5' into fix-phpunit-coverage-path-and-testsuites
Browse files Browse the repository at this point in the history
  • Loading branch information
alecritson authored Sep 22, 2023
2 parents 86612e7 + 87386d4 commit 3151ee7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/Base/Validation/CouponValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
namespace Lunar\Base\Validation;

use Lunar\DiscountTypes\AmountOff;
use Lunar\DiscountTypes\BuyXGetY;
use Lunar\Models\Discount;

class CouponValidator implements CouponValidatorInterface
{
public function validate(string $coupon): bool
{
return Discount::whereType(AmountOff::class)
return Discount::whereIn('type', [AmountOff::class, BuyXGetY::class])
->active()
->where(function ($query) {
$query->whereNull('max_uses')
Expand Down

0 comments on commit 3151ee7

Please sign in to comment.