Home > front end >  Laravel - Stripe still showing archived plans
Laravel - Stripe still showing archived plans

Time:01-13

I used this in my controller:

\Stripe\Stripe::setApiKey(config('services.stripe.secret'));
$plans = \Stripe\Plan::all();

Here's the foreach on my blade file:

@foreach($plans as $plan)
        <div >
            <input  name="plan" type="radio" id="radio{{$plan->id}}" value="{{$plan->id}}" checked />
            <label  for="radio{{$plan->id}}">{{$plan->product->name}} (${{$plan->amount/100}}/{{$plan->interval}})</label>
        </div>
@endforeach

But it's still showing archived products AND prices?? How do I hide archived products & prices?

Searched around and can't find an answer

CodePudding user response:

Try using might fix this

$plans = \Stripe\Plan::all(["active" => true]);

Stripe API Reference

  • Related