refactor: ⚡️ remove coupon instance from event
This commit is contained in:
parent
fc84e7d1db
commit
4873992c48
|
@ -19,9 +19,10 @@ class CouponUsedEvent
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(Coupon $coupon, string $couponCode)
|
public function __construct(string $couponCode)
|
||||||
{
|
{
|
||||||
$this->coupon = $coupon;
|
|
||||||
$this->couponCode = $couponCode;
|
$this->couponCode = $couponCode;
|
||||||
|
$this->coupon = Coupon::where('code', $couponCode)->first();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue