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."
@wiggonator
try this
Auth::user()->current_billing_plan
@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 sign in or create an account to participate in this conversation.