PHPackages                             kmrifat/laravel-shopify - 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. kmrifat/laravel-shopify

ActiveLibrary[API Development](/categories/api)

kmrifat/laravel-shopify
=======================

1.0.0(2y ago)112↓100%PHP

Since Nov 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/kmrifat/laravel-shopify)[ Packagist](https://packagist.org/packages/kmrifat/laravel-shopify)[ RSS](/packages/kmrifat-laravel-shopify/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Laravel Shopify
===============

[](#laravel-shopify)

It's an api first approach laravel wrapper, comes with shopify authentication and easy access shopify api.

### History

[](#history)

After deprecate of [gnikyt/laravel-shopify](https://github.com/gnikyt/laravel-shopify/discussions/1276), i tried Shopify's official php wrapper, but i found it highly focus on shopify so hard to implement other platform on it, and hard to build api oriented SPA app for shopify app store.

I was looking for something where i have the freedom to architect my own application, so i decided to build one.
I use [laravel socialite](https://laravel.com/docs/10.x/socialite) so all the laravel dev can easily use this wrapper package hassle-free.

### Installation

[](#installation)

use this command bellow in your existing laravel project

```
composer require kmrifat/laravel-shopify
```

### Publish providers

[](#publish-providers)

```
php artisan vendor:publish --provider="Kmrifat\Shopify\ShopifyServiceProvider"
php artisan migrate
```

### Using shopify in your project

[](#using-shopify-in-your-project)

```
use Kmrifat\Shopify\Facades\Shopify;

$shopify = Shopify::shop('domain.myshopify.com','access_token');

// use rest get request
$shopify->rest()->get('products/{product_id}');
// you will only need to pass topic instate passing the entire url

// use post method to modify anything in shopify, the first argument will be the topic and second one will be the payload
$shopify->rest()->post('products', []);

// use graphql
$shopify->graph()->executeQuery([
    'query' => 'query_string',
    'variables' => [] // pass query variables
]);
```

For quick and easy access you can create a method in `User` model like this example bellow

```
namespace App\Models;
use Kmrifat\Shopify\Facades\Shopify;

class User extends Authenticatable
{
    public function shopify()
    {
        return return Shopify::shop($this->name, $this->shopify_access_token);
        // $this->name = shopify shop domain
        // $this->shopify_access_token = shopify store access token
        // you can store the shop domain and access token anywhere you want, all you just need to pass this in shop parameter
    }
}
```

### Env

[](#env)

add this keys and value in your env to power this package to perform authentication and other activities

```
SHOPIFY_APP_NAME= #put your app name and wrape them in duble quite "My Shopify APP"
SHOPIFY_APP_CLIENT_ID=#"Your shopify app client id"
SHOPIFY_APP_SECRET=#"Your shopify app secret"
SHOPIFY_APP_REDIRECT=#"Create a redirect url at your route and pase the redirect url here. i.e: /auth/callback"
SHOPIFY_APP_SCOPES=#put the app scopes and seperate them by (,) comma
SHOPIFY_WEBHOOK=#for local development you can put ngrok url to recieve the webhook response, for production replcae it by your main domain
```

If you are planning to build an api interactive app then you can ignore `SHOPIFY_APP_REDIRECT` as you are handling it by the frontend.
Checkout this link to [create shopify app](https://partners.shopify.com/)

### Authentication

[](#authentication)

The package using [socialite](https://laravel.com/docs/10.x/socialite) for shopify authentication, all you need to use `shopify` driver in socialite. See the example bellow

```
Route::get('/', function () {
    if (request()->has('shop')) {
    // If you want to authenticate in shopify store from the app, you just need to pass the shopify store name in shop query string,
    // i.e: yourdomain.com?shop=your-shopify-store
        return \Laravel\Socialite\Facades\Socialite::driver('shopify')->stateless()->scopes(config('shopify.scopes'))
            ->with(['redirect_uri' => $request->redirect_uri ?? config('shopify.redirect')])
            ->redirect(); // use ->getTargetUrl() before closing statement if you are build an API oriented application, so it will return your the redirect url instate redirect from the backend
    }
    return view('welcome');
});

Route::get('/auth/callback', function () {
    $shopifyUser = \Laravel\Socialite\Facades\Socialite::driver('shopify')->stateless()->user();
    $user = User::updateOrCreate([
        'email' => $shopifyUser->email,
    ], [
        'name' => $shopifyUser->nickname,
        'email' => $shopifyUser->email,
        'shopify_access_token' => $shopifyUser->token,
    ]);

    // you can use passport / sanctum or any of favorite  to perform the authentication
    Auth::login($user, true);

    return redirect('/dashboard');
});
```

### Webhooks

[](#webhooks)

To register webhook all you need is to create a job and register this job in `conifg/shopify.php`

```
'webhooks' => [
    ['shopify/webhook', \App\Jobs\YourJob::class] // first element of this array will be the topic of webhook and second element of this array will your targeted job of the webhook
]
```

### Example Project

[](#example-project)

```
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

910d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/762b379eb227882f159b8327db1eec9bc779071d84434ea077c3249f08aa9f33?d=identicon)[kmrifat](/maintainers/kmrifat)

---

Top Contributors

[![kmrifat](https://avatars.githubusercontent.com/u/6764959?v=4)](https://github.com/kmrifat "kmrifat (7 commits)")

### Embed Badge

![Health badge](/badges/kmrifat-laravel-shopify/health.svg)

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[revolution/laravel-bluesky

Bluesky(AT Protocol) for Laravel

4317.3k](/packages/revolution-laravel-bluesky)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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