Order it to get just latest plan.
$plan = Spark::plans()->where('id', $user->current_billing_plan)->latest()->first();
->latest() use as a default created_at column.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
I'm working with Spark (for the first time) and I got a bit confused about retrieving user's current plan.
I'm currently doing the following:
$plan = Spark::plans()->where('id', $user->current_billing_plan)->first();
It works great until the user upgrades the plan. Once he upgraded $plan doesn't feature the new selected plan. It remains the same, although user upgraded to a different plan.
Any clarification on this would be great.
Oh yeah sorry for that. It's because ->where('id', $user->current_billing_plan).
Current plan you can also get with
$user->sparkPlan();
Please or to participate in this conversation.