jason3w's avatar

Get products from Shopify

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.

0 likes
2 replies

Please or to participate in this conversation.