PHPackages                             culturekings/shopify-app-auth-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. culturekings/shopify-app-auth-laravel

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

culturekings/shopify-app-auth-laravel
=====================================

Shopify OAuth App for Laravel 5.x

3.4(8y ago)1013.3k5[4 PRs](https://github.com/culturekings/shopify-app-auth-laravel/pulls)MITPHPPHP &gt;=5.6.4

Since May 9Pushed 3y ago14 watchersCompare

[ Source](https://github.com/culturekings/shopify-app-auth-laravel)[ Packagist](https://packagist.org/packages/culturekings/shopify-app-auth-laravel)[ RSS](/packages/culturekings-shopify-app-auth-laravel/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (31)Used By (0)

shopify-app-auth-laravel
========================

[](#shopify-app-auth-laravel)

Laravel Auth Boilerplate for Shopify App

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

[](#installation)

### Install

[](#install)

`composer require culturekings/shopify-app-auth-laravel`

### Add to Providers

[](#add-to-providers)

Add to Providers in config/app.php `CultureKings\ShopifyAuth\ShopifyAuthServiceProvider::class`

### Publish

[](#publish)

`php artisan vendor:publish`

### Setup Views

[](#setup-views)

#### Install Success page

[](#install-success-page)

In your resources/views folder, create your folder and install-sucess.blade.php file, and then within `shopify-auth.app_name`, set your `view_install_success_path` value to whatever it is (see below in configure app for example).

### Auth Middleware

[](#auth-middleware)

Set the middleware on routes - ensure that ShopifyAuthCheck if sitting around the routes. Web too, but I think that is standard in the web.php file. Also note that when creating routes, the appname must be second in the url route e.g. apps/app\_name/create.

```
Route::group(
    [
        'prefix' => 'shopify-apps',
        'namespace' => 'ShopifyApps',
        'middleware' => 'CultureKings\ShopifyAuth\Http\Middleware\ShopifyAuthCheck'
    ],
    function () {
        Route::get('appname', 'AppnameController@getDashboard');
    }
);
```

### Configure App in config

[](#configure-app-in-config)

Once published, set up your app.

You can see below that everything is setup under "appname" and then app\_name is used from then on.

In the routes, you see that appName is passed as a variable in the auth url, so this is very important that url is the same as the array key of "appname".

You can change this to be whatever you like so you can run multiple apps through a single auth flow.

```
'appname' => [
    'name' => 'app_name', // checked in db, so shouldn't change after launch
    'price' => 0.00,
    'redirect_url' => '/shopify-auth/app_name/auth/callback', // relative uri
    'success_url' => '/shopify-auth/app_name/install/success',
    'dashboard_url' => '/apps/app_name/dashboard',
    'scope' => [
        "write_products",
        "write_script_tags"
    ],
    'view_folder_path' => 'shopify-apps.app_name',
    'view_install_success_path' => 'shopify-apps.app_name.install-success',
    'key' => env("SHOPIFY_APPNAME_APIKEY"),
    'secret' => env("SHOPIFY_APPNAME_SECRET"),
],
```

Usage
-----

[](#usage)

All shopify calls should be made through a service and make a call similar to below:

```
// $appName comes from url passed into method as param (look at middleware)
$shopifyAppConfig = config('shopify-auth.'.$appName);

/ call shopify api
$this->shopify
    ->setKey($shopifyAppConfig['key'])
    ->setSecret($shopifyAppConfig['secret'])
    ->setShopUrl($shopUrl)
    ->setAccessToken($accessToken)
    ->post('admin/script_tags.json', $scriptTags);
```

### Authenticate Shop App

[](#authenticate-shop-app)

Navigate to: `http://exampledomain.dev/shopify-auth/app_name/install?shop=shopifydomain.myshopify.com`

It will then redirect you to your shops auth process to start

### Common Controller Setup

[](#common-controller-setup)

I'd generally use this as the construct:

```
public function __construct(ShopifyApi $shopify, Request $request, ShopifyAuthService $shopifyAuthService)
{
     $this->shopify = $shopify;
     $this->shopifySession = $request->session()->get('shopifyapp');
     $this->shopifyAuthService = $shopifyAuthService;
 }
```

Then set up a method:

```
public function getDashboard()
{
    $shopUrl = $this->shopifySession['shop_url'];
    $appName = $this->shopifySession['app_name'];

    // find user, then get countdowns based on that
    $user = ShopifyUser::where([
        'shop_url' => $shopUrl,
        'app_name' => $appName,
    ])->first();

    $appConfig = config('shopify-auth.' . $appName);

    $this->checkExistsAndCreateScriptTag($shopUrl, $user->access_token, $user, $appName);

    return view('app_name.dashboard')->with([
        'app_key' => config($appConfig['key']),
    ]);
}
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 98.4% 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 ~2 days

Total

26

Last Release

3240d ago

Major Versions

v0.7 → v1.02017-05-09

v1.6 → v2.02017-05-25

v2.6 → v3.02017-06-08

### Community

Maintainers

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

![](https://avatars.githubusercontent.com/u/17635174?v=4)[Culture Kings](/maintainers/culturekings)[@culturekings](https://github.com/culturekings)

![](https://www.gravatar.com/avatar/89f4b2dc9b243ef9bcb85efa3a50321653ee2da59872ac23baa93d5a31791de8?d=identicon)[jared-fraser](/maintainers/jared-fraser)

---

Top Contributors

[![jonathan-bird](https://avatars.githubusercontent.com/u/1510001?v=4)](https://github.com/jonathan-bird "jonathan-bird (60 commits)")[![jared-fraser](https://avatars.githubusercontent.com/u/1113900?v=4)](https://github.com/jared-fraser "jared-fraser (1 commits)")

---

Tags

appauthecommercelaravellaravel5-packageshopify

### Embed Badge

![Health badge](/badges/culturekings-shopify-app-auth-laravel/health.svg)

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

###  Alternatives

[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[laragear/two-factor

On-premises 2FA Authentication for out-of-the-box.

339785.3k8](/packages/laragear-two-factor)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[rahul900day/laravel-captcha

Different types of Captcha implementation for Laravel Application.

10715.9k](/packages/rahul900day-laravel-captcha)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)

PHPackages © 2026

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