Level 14
The code looks good. I think something went wrong creating the coupon.
Could you submit a screenshot from your dashboard or submit the response from GET /v1/coupons?
Thanks
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello guys, I'm using Laravel Cashier with Stripe and I have a problem regarding to the coupon applying. If i'm trying to use a coupon I always get response coupon not found 'halfprice'
halfprice
3.Backend Handling
$this->validate($request, [
'token' => 'required',
'plan' => 'required|exists:plans,slug',
'coupon' => 'nullable'
]);
$cleaned_plan = Purifier::clean($request->plan);
$request_plan = strip_tags($cleaned_plan);
$cleaned_token = Purifier::clean($request->token);
$request_token = strip_tags($cleaned_token);
$plan = Plan::where('slug', $request_plan)->first();
auth()->user()->newSubscription('pro', $plan->stripe_id)
->withCoupon($request->coupon)
->create($request_token);
Please or to participate in this conversation.