Sad that no-one has answered this as I have the same question.
Check Stripe subscription status
I want to add middleware to check if the user has an active Stripe subscription, then allow/restrict access to routes.
In 5.2 they got rid of the very handy $user->subscribed() method, now requiring you to call it with a plan name argument $user->subscribed('plan-name').
How do you get the users plan name to call this method with?
I added a quick hasOne association in my User model to then called the subscribed method like:
$user->subscribed( $user->subscription['name'] )
..which seems like it should work fine, but it was messing up some of my routes and throwing this error: Call to undefined method Illuminate\Database\Query\Builder::active()
Am I going about this the right way, or how does everyone else quickly check if a User has an active subscription? I don't understand why they changed this method to require a plan-name argument..
Thanks for any help!
Please or to participate in this conversation.