6 months ago

using Laravel Cashier how can I access User's subscribed Plan?

Posted 6 months ago by bwrigley

Is there a way to access the plan a User is subscribed to directly from the Subscription?

I can get the plan id from the Subscription and look that up like this

$planId = $user->subscription('default')->stripe_plan;
$plan = Plan::where('stripe_id',$planId)->first();

but I'm curious why there isn't a relationship method

$plan = $user->subscription('default')->plan;

perhaps there is something similar that I haven't spotted?

Please sign in or create an account to participate in this conversation.