got it. so simple
$response = @file_get_contents($baseUrl.'products.json'); //set the url
cheers :)
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey guys, New to Laravel. Attempting to get products from Shopify via their API. I've manage it outside of Laravel, but the same code fails to work in Laravel. Mainly i need to figure out how to get the json file from Shopify.
I have this in the ProductsController
// Get cURL resource
$curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url
CURLOPT_USERAGENT => 'Codular Sample cURL Request'
));
// Send the reque st & save response to $resp
$response = curl_exec($curl);
// Close request to clear up some resources
curl_close($curl);
I get this error ReflectionException in Route.php line 280: Class App\Http\Controllers\ProductsController does not exist
Any ideas much appreciated.
Please or to participate in this conversation.