diff --git a/app/Events/CouponUsedEvent.php b/app/Events/CouponUsedEvent.php index ceb0ac37..54b322bd 100644 --- a/app/Events/CouponUsedEvent.php +++ b/app/Events/CouponUsedEvent.php @@ -19,9 +19,10 @@ class CouponUsedEvent * * @return void */ - public function __construct(Coupon $coupon, string $couponCode) + public function __construct(string $couponCode) { - $this->coupon = $coupon; + $this->couponCode = $couponCode; + $this->coupon = Coupon::where('code', $couponCode)->first(); } }