Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

spar_x's avatar

why does spark keep hitting /coupon/user/{id} with a 404?

I haven't set up any coupons and don't use them, but for some reason it hits this url on every request and returns a 404. Anyone know why? I think this only started happening since I upgraded to 5.3/2.0

0 likes
5 replies
ejdelmonico's avatar

Created a coupon and the 404 disappeared. However, if a new user registers, the 404 returns.

UPDATE: here is what I found in the code:

public function current(Request $request, $userId)
    {
        $user = Spark::user()->where('id', $userId)->firstOrFail();

        if ($coupon = $this->coupons->forBillable($user)) {
            return response()->json($coupon->toArray());
        }

        abort(404);
    }

It is supposed to 404 from what I can tell.

spar_x's avatar

yea I saw that as well.. just weird that a default functionality would have a 404 thrown in the console on every page refresh for every user.. i don't like red messages :(

ejdelmonico's avatar

I agree. I would prefer not to have a 404 error as well.

duellsy's avatar

Just spent a while trying to figure this out...

Not a fan of having the red 404 message in console but glad others are having this same.

Anybody made any progress on this?

Please or to participate in this conversation.