Introducing Laravel Shopify

Laravel Shopify is an opinionated package that provides you with a beautiful wrapper for the Admin API. It gives you all the methods you need to build robust integrations with Shopify.

I knew that to get it right I was going to have to replicate the viewing conditions of someone from the future, so I grabbed my space helmet from the closet, created a new Figma document, and got to work.

Key Features

  • Provides a simple, easy-to-learn wrapper around the Shopify API
  • Uses the build-in Laravel HTTP client
  • Supports REST and GraphQL

Getting started

To get started pull in the package using composer:

composer require pactode/laravel-shopify

Once the package is installed, you can update your .env file with the necessary credentials to start making requests.

SHOPIFY_ACCESS_TOKEN={token}
SHOPIFY_DOMAIN={handle}.myshopify.com
SHOPIFY_API_VERSION=2023-07

Making your first request

From your routes/web.php file, you can add a new route to test the integration.

use Pactode\Shopify\Shopify;

Route::get('shopify', function (Shopify $shopify) {
    $products = $shopify->getProducts();

    // dump products or...
    // $products->dd();
});

And that's it! You're ready to make requests to the Shopify API.

If you have any questions, or want to contribute, feel free to check out the repository on Github.