PHPackages                             maxepam2015/shopify-integration - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. maxepam2015/shopify-integration

ActiveLibrary[API Development](/categories/api)

maxepam2015/shopify-integration
===============================

A Laravel package for integrating Shopify API

1.1.2(8mo ago)06MITPHPPHP ^8.3

Since Oct 10Pushed 8mo agoCompare

[ Source](https://github.com/MaxEpam2015/laravel-package-shopify-integration)[ Packagist](https://packagist.org/packages/maxepam2015/shopify-integration)[ RSS](/packages/maxepam2015-shopify-integration/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (4)Used By (0)

Laravel [![Laravel](https://camo.githubusercontent.com/96115801e7ed0745c443b8c55b8e99f98380b27a1f59ac984f4364bc1c508459/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f392f39612f4c61726176656c2e737667)](https://camo.githubusercontent.com/96115801e7ed0745c443b8c55b8e99f98380b27a1f59ac984f4364bc1c508459/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f392f39612f4c61726176656c2e737667) + Shopify [![Shopify](https://camo.githubusercontent.com/70177386831f572e4ddb05c25e326c2eb953fc7965cc1c8c264ba74d818b9566/68747470733a2f2f63646e2d69636f6e732d706e672e666c617469636f6e2e636f6d2f3531322f353936382f353936383838372e706e67)](https://camo.githubusercontent.com/70177386831f572e4ddb05c25e326c2eb953fc7965cc1c8c264ba74d818b9566/68747470733a2f2f63646e2d69636f6e732d706e672e666c617469636f6e2e636f6d2f3531322f353936382f353936383838372e706e67) Integration Package
===============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#laravel---shopify---integration-package)

### A modern, production-ready Laravel package for connecting your app to Shopify with full OAuth authentication, multi-store support, and Laravel integration.

[](#a-modern-production-ready-laravel-package-for-connecting-your-app-to-shopify-with-full-oauth-authentication-multi-store-support-and-laravel-integration)

🚀 Why Use This Package

This package provides: ✅ Deep Laravel integration (service providers, routers, requests, services, tests, middleware, artisan command, migration) 🔐 Production-ready OAuth authentication and shop session management 🧑‍💼 Multi-store token handling 🧰 Easy access to Shopify REST and GraphQL APIs 🧩 Configuration, migrations, and routing out of the box 🧪 Testable, extensible architecture for your own Shopify apps

With this package, you spend less time writing boilerplate and more time building features merchants love.

⚙️ Prerequisites

Before you begin, make sure you have:

- PHP 8.3+
- Laravel 10+
- Composer installed
- A [Shopify Partner Account](https://partners.shopify.com/)to create your app and get credentials
- A Shopify development store for testing
- [ngrok](https://ngrok.com/) for HTTPS tunneling during local OAuth testing

### 🧩 Step 1: Install the Package

[](#-step-1-install-the-package)

From your Laravel project root:

```
composer require maxepam2015/shopify-integration

```

If developing locally via path repository, ensure your main project composer.json includes:

```
"repositories": [
  {
    "type": "path",
    "url": "packages/Max/ShopifyIntegration"
  }
]

```

### ⚙️ Step 2: Publish Config and Migration Files

[](#️-step-2-publish-config-and-migration-files)

```
php artisan vendor:publish --provider="Max\ShopifyIntegration\ShopifyServiceProvider"

```

This publishes:

- config/shopify.php
- database/migrations/2025\_10\_09\_856483\_create\_shopify\_stores\_table.php

### 🗄️ Step 3: Run the Migrations

[](#️-step-3-run-the-migrations)

```
php artisan migrate

```

This creates the shopify\_stores table used to store connected shops and their OAuth tokens.

### 🔑 Step 4: Configure Your App Credentials

[](#-step-4-configure-your-app-credentials)

Edit your .env file:

```
SHOPIFY_API_KEY=your-shopify-api-key
SHOPIFY_API_SECRET=your-shopify-api-secret
SHOPIFY_API_SCOPES=read_products,write_products
SHOPIFY_REDIRECT_URI=https://your-ngrok-url.ngrok-free.dev/api/shopify/callback
SHOPIFY_API_VERSION=2025-01
```

make sure your settings match your Shopify app dashboard (especially API Key, Secret, Scopes, Redirect URLs).

### 🧭 Step 5: Update Your Shopify App URLs

[](#-step-5-update-your-shopify-app-urls)

In your Shopify Partner Dashboard → App setup:

FieldValue**App URL**`https://your-ngrok-url.ngrok-free.dev`**Allowed redirection URL(s)**`https://your-ngrok-url.ngrok-free.dev/api/shopify/callback`### 🛠️ Step 6: OAuth Flow (No /install Route)

[](#️-step-6-oauth-flow-no-install-route)

Merchants (or you, for your dev store) can install the app manually using the direct OAuth URL below:

```
https://your-store.myshopify.com/admin/oauth/authorize?client_id={SHOPIFY_API_KEY}&scope={SHOPIFY_SCOPES}&redirect_uri={SHOPIFY_REDIRECT_URI}

```

When authorization completes, Shopify redirects to:

```
https://your-ngrok-url.ngrok-free.dev/api/shopify/callback?code=xxxx&shop=your-store.myshopify.com

```

Your package handles this automatically and securely stores the access token in the shopify\_stores table.

### 🧩 Step 7: Access Connected Shops via Model

[](#-step-7-access-connected-shops-via-model)

The package includes a ready-to-use Eloquent model:

```
use Max\ShopifyIntegration\Models\ShopifyStore;

$store = ShopifyStore::firstWhere('shop', 'your-store.myshopify.com');
$token = $store->access_token;
```

### 🌐 Step 8: Fetch Products via API

[](#-step-8-fetch-products-via-api)

Once the shop is connected, you can call the /api/shopify/products endpoint:

```
GET /api/shopify/products?shop=your-store.myshopify.com

```

Response example:

```
{
  "products": [
    { "id": 123456789, "title": "T-Shirt", "price": "29.99" },
    { "id": 987654321, "title": "Hat", "price": "19.99" }
  ]
}
```

**Under the hood**ShopifyClient dynamically loads the shop’s token and sends the request:

```
use Max\ShopifyIntegration\Services\ShopifyClient;

$shopify = new ShopifyClient('your-store.myshopify.com');
$products = $shopify->getProducts();
```

### 🔐 Step 9: Middleware Protection (Optional)

[](#-step-9-middleware-protection-optional)

You can protect your routes to ensure only connected stores access them:

```
Route::middleware(['auth.shopify'])->group(function () {
    Route::get('/dashboard', [DashboardController::class, 'index']);
});
```

### 🧠 Step 10: Testing Locally with ngrok

[](#-step-10-testing-locally-with-ngrok)

For development, run:

```
php artisan serve
ngrok http 8000

```

Use the generated HTTPS URL (e.g., ) in your .env and Shopify App setup. Then open:

```
https://your-store.myshopify.com/admin/oauth/authorize?client_id=your-key&scope=read_products&redirect_uri=https://your-app.ngrok-free.dev/api/shopify/callback

```

and approve the permissions. After the redirect, your Laravel app will automatically store the access token.

### 🧩 Directory structure

[](#-directory-structure)

```
ShopifyIntegration/
├── config/shopify.php
├── database/migrations/2025_10_09_856483_create_shopify_stores_table.php
├── routes/api.php
├── src/
│   ├── Models/ShopifyStore.php
│   ├── Services/
│   │   ├── ShopifyClient.php
│   │   ├── OAuthService.php
│   │   └── ProductService.php
│   ├── Http/
│   │   └── Controllers/
│   │       ├── OAuthController.php
│   │       └── ProductController.php
│   │   └── Requests/
│   │       └── OAuth/
│   │           └── CallbackRequest.php
│   │           └── InstallRequest.php
│   │       └── Product/
│   │           └── IndexRequest.php
│   │   └── Middleware/
│   │       └── AuthenticateShopify.php
│   └── ShopifyServiceProvider.php
├── tests/
│   ├── TestCase.php
│   ├── OAuthControllerTest.php
│   ├── ShopifyClientTest
│   └── ProductControllerTest.php
├── composer.json
├── phpunit.xml
└── README.md

```

### 🧪 Testing

[](#-testing)

#### Option 1: Run Only the Package Tests

[](#option-1-run-only-the-package-tests)

```
vendor/bin/phpunit

```

#### Option 2: run Tests by docker (Package + App)

[](#option-2-run-tests-by-docker-package--app)

```
docker compose up

```

From your Laravel project root:

### 🤝 Contributing

[](#-contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Make sure your PR includes:

- Tests for new or changed functionality
- Clear commit messages
- Code that follows PSR-12 formatting guidelines

### 📄 License

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance59

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

3

Last Release

261d ago

PHP version history (2 changes)1.0.0PHP ^8.2

1.1.1PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12913258?v=4)[MaxEpam2015](/maintainers/MaxEpam2015)[@MaxEpam2015](https://github.com/MaxEpam2015)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/maxepam2015-shopify-integration/health.svg)

```
[![Health](https://phpackages.com/badges/maxepam2015-shopify-integration/health.svg)](https://phpackages.com/packages/maxepam2015-shopify-integration)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.7k1](/packages/jasara-php-amzn-selling-partner-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
