FleetCart/Modules/Coupon/Checkers/ValidCoupon.php

19 lines
336 B
PHP
Raw Normal View History

2023-06-11 12:14:03 +00:00
<?php
namespace Modules\Coupon\Checkers;
use Closure;
use Modules\Coupon\Exceptions\InvalidCouponException;
class ValidCoupon
{
public function handle($coupon, Closure $next)
{
if ($coupon->invalid()) {
throw new InvalidCouponException;
}
return $next($coupon);
}
}