PHPackages                             bryanyeh/shopify-laravel - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. bryanyeh/shopify-laravel

ActiveLibrary[HTTP &amp; Networking](/categories/http)

bryanyeh/shopify-laravel
========================

Shopify API for Laravel 5.4 using Guzzle

1.10(8y ago)62291MITPHPPHP &gt;=7.0.0

Since Aug 27Pushed 8y ago2 watchersCompare

[ Source](https://github.com/BryanYeh/shopify-laravel)[ Packagist](https://packagist.org/packages/bryanyeh/shopify-laravel)[ RSS](/packages/bryanyeh-shopify-laravel/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (3)Used By (0)

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

[](#laravel-shopify)

This package is only for Laravel integration with Shopify's API to make a public app

[![Latest Stable Version](https://camo.githubusercontent.com/eec71cdd3551951181d6d1828aee2b4d0e869795bfec3ef0e7970f2c388ce58e/68747470733a2f2f706f7365722e707567782e6f72672f627279616e7965682f73686f706966792d6c61726176656c2f762f737461626c65)](https://packagist.org/packages/bryanyeh/shopify-laravel) [![Total Downloads](https://camo.githubusercontent.com/01052fd7975102879506f96637ca6ecd2ee049f735f47e4870e69f5ffdffbb52/68747470733a2f2f706f7365722e707567782e6f72672f627279616e7965682f73686f706966792d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/bryanyeh/shopify-laravel) [![License](https://camo.githubusercontent.com/309067c704a9901ae1063eda241d716eaa6d8eac38484f8d8a3995a5f1d7945d/68747470733a2f2f706f7365722e707567782e6f72672f627279616e7965682f73686f706966792d6c61726176656c2f6c6963656e7365)](https://packagist.org/packages/bryanyeh/shopify-laravel)

Requirements
------------

[](#requirements)

- Laravel 5.4
- PHP 7+

Installation
------------

[](#installation)

Using command line

```
composer require bryanyeh/shopify-laravel 1.10

```

Edit your `.env` file add and replace with no `< >`

```
SHOPIFY_API_KEY=
SHOPIFY_API_SECRET=
SHOIFY_API_SCOPES=

```

Add to providers arrray in `config/app.php`

```
Bryanyeh\Shopify\Providers\ShopifyServiceProvider::class,

```

Add to aliases array `in config/app.php`

```
'Shopify' => Bryanyeh\Shopify\Facades\Shopify::class,

```

Add to routeMiddleware array in `app/http/Kernel.php`

```
'shopifyrequest' => \Bryanyeh\Shopify\Middleware\VerifyRequest::class,
'shopifynonce' => \Bryanyeh\Shopify\Middleware\VerifyNonce::class,
'shopifywebhook' => \Bryanyeh\Shopify\Middleware\VerifyWebHook::class,
'shopifyproxy' => \Bryanyeh\Shopify\Middleware\VerifyProxy::class,

```

In the command line

```
php artisan vendor:publish --provider="Bryanyeh\Shopify\Providers\ShopifyServiceProvider"

```

Usage:
------

[](#usage)

Make sure to use `use Bryanyeh\Shopify\Facades\Shopify;` wherever you are planning to use this package.

### Asking for permission to install the app

[](#asking-for-permission-to-install-the-app)

Make sure to use the middleware `shopifyrequest`

```
use Bryanyeh\Shopify\Facades\Shopify;

Route::get('install', function(Request $request){
    return redirect(Shopify::init($request->input('shop'))->install('https://example.com/confirm'));
})->middleware('shopifyrequest');
```

### Retreiving the access token

[](#retreiving-the-access-token)

To do this you will need to use the middlewares `shopifynonce` and `shopifyrequest`

```
use Bryanyeh\Shopify\Facades\Shopify;

Route::get('confirm', function(Request $request){
    $access_token = Shopify::init($request->input('shop'))->getAccessToken($request->input('code'))['access_token'];

    //save the access_token for later use

    //redirect to success or billing page

})->middleware('shopifynonce', 'shopifyrequest');
```

### Verifying webhooks

[](#verifying-webhooks)

Simply use the middleware `shopifywebhook`

### Verifying proxy requests

[](#verifying-proxy-requests)

Simply use the middleware `shopifyproxy`

### Accessing API resource

[](#accessing-api-resource)

```
use Bryanyeh\Shopify\Facades\Shopify;

$geturi = '/admin/products/count.json' ;
$posturi = '/admin/products.json';
$puturi = '/admin/products/632910392.json';
$deleteuri = '/admin/products/632910392.json';

$shop = Shopify::init($my_shopify_store,$access_token);
$shop->get($geturi, [if any]);
$shop->post($posturi, [data]);
$shop->put($puturi, [data]);
$shop->delete($deleteuri);
```

Everything that gets will be in a form of an array containing:

```
statusCode   :  200 or 400 or status code
reasonPhrase :  just a phrase that goes with the status code
callLimit    :  HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT
????         :  expected response data shopify returns

```

### Middlewares

[](#middlewares)

- `shopifywebhook` returns 401 error when hmac is invalid
- `shopifyproxy` returns 401 error when signature or domain are invalid
- `shopifynonce` and `shopifyrequest`, will redirect to a named route `re-auth`, with this you can decide what to do if either the nonce or request is invalid

Errors
------

[](#errors)

This package throws only 1 exception.

- `InvalidMethodRequestException`
    - only `get/post/put/delete` is allowed, look at [Acessing API Resource](#accessing-api-resource)

Notes:
------

[](#notes)

- Nonce is automatically taken care for you
- Make sure to add your incoming webhook routes to the `app/Http/Middleware/VerifyCsrfToken.php` in the `except` array

License
-------

[](#license)

Laravel Shopify is licensed under [MIT License (MIT)](LICENSE.md).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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

Every ~6 days

Total

2

Last Release

3175d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c60f685b47fa87b682f16a39156c6f4a56822a00edf8f6d5985627e03d86f891?d=identicon)[BryanYeh](/maintainers/BryanYeh)

---

Top Contributors

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

---

Tags

laravel-5-packagelaravel-packagelaravel54shopify-apiapilaravelGuzzleshopify

### Embed Badge

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

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

###  Alternatives

[hamburgscleanest/guzzle-advanced-throttle

A Guzzle middleware that can throttle requests according to (multiple) defined rules. It is also possible to define a caching strategy, e.g. get response from cache when rate limit is exceeded or always get cached value to spare your rate limits.

13033.4k1](/packages/hamburgscleanest-guzzle-advanced-throttle)[denpa/laravel-bitcoinrpc

Bitcoin JSON-RPC Service Provider for Laravel

9053.4k](/packages/denpa-laravel-bitcoinrpc)[pingpong/facebook

Facebook OAuth v4 for Laravel Framework

1129.7k](/packages/pingpong-facebook)[dreamfactory/df-core

DreamFactory(tm) Core Components

1651.7k20](/packages/dreamfactory-df-core)

PHPackages © 2026

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