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

brijitha's avatar

Seek Advice: laravel cashier stripe credential saved on AWS secret manager shows API unavailable on swap function

Hi, I cleared the .env file , there is no credentials saved on .env file. so the variables are saved on the aws secret manager fetching the variable via somefunction('VARIABLE"). that variable is not available as env("VARIABLE"). Payment and all functions are working well except the swap(). please help me finding a solution.

0 likes
1 reply
martinbean's avatar

@brijitha Why are you storing variables in Secrets Manager that now mean you need to make an API call to AWS every time you need to do anything Stripe-related?

Fetching secrets has a cost, and looking up a secret each and every time you need it is not what Secrets Manager for. That’s just one way to run up an unexpected AWS bill.

You should instead be grabbing the values from Secrets Manager and setting them as environment variables during deployments. Then they will be available to your Laravel application as expected.

1 like

Please or to participate in this conversation.