Level 75
Am I doing anything wrong?
Yes, you use envoutside of config files.
Docs: https://laravel.com/docs/8.x/configuration#configuration-caching
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Im trying to implement stripe and Im all good until I try and retrieve a subscription
I send my secret and sub id and get a 200 ok and a blank response
Am I doing anything wrong?
//Create a new stripe instance
$stripe = new \Stripe\StripeClient(
config('stripekeys.secret')
);
//Retrieve stripe record
$stripe->subscriptions->retrieve(
'sub_IV0LDLuFIfKvce'
);
//Build return data
$data = [
'status' => 200,
'data' => $stripe
];
//Return data
return response($data);
I followed the docs here https://stripe.com/docs/api/subscriptions/retrieve?lang=php
$stripe = new \Stripe\StripeClient(
config('stripekeys.secret')
);
//Retrieve stripe record
$return = $stripe->subscriptions->retrieve(
'sub_IV0LDLuFIfKvce'
);
//Build return data
$data = [
'status' => 200,
'data' => $return
];
//Return data
return response($return);
This works perfectly
Please or to participate in this conversation.