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

wiggonator's avatar

Spark - Select all users on a specific plan

I'm looking for a way to find all users on a specific plan. In order to get the plan name I tried this: $plan = Spark::plans()->find('Standard');

However I get an error: "Method Illuminate\Support\Collection::find does not exist."

0 likes
2 replies
wiggonator's avatar

@rameezisrar, That works if you know the user. My question was a bit different. What if you want a list of all users on the 'Standard' plan.

Something like: SPARK::plans()->find('Standard')->users()->get()...

Any ideas?

Right now I have to do it in multiple passes: $plans = Spark::plans()->where('name', 'Standard')->all(); foreach ($plans as $plan) { $usersStandard = User::where('current_billing_plan', $plan->id)->get(); }

Please or to participate in this conversation.