Download the PHP package esign/laravel-shopify without Composer

On this page you can find all versions of the php package esign/laravel-shopify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-shopify

Laravel Shopify

run-tests

A modern Laravel package for building embedded Shopify apps using session tokens and Shopify Managed Installation. Built on top of the official shopify/shopify-app-php library.

Features

Requirements

Installation

1. Install via Composer

2. Publish Configuration & Migrations

This publishes:

3. Configure Environment

Add to your .env:

Important: Do NOT set SHOPIFY_SCOPES in your .env file. Scopes are managed by Shopify CLI via your shopify.app.toml file.

How It Works

Shopify Managed Installation

This package uses Shopify Managed Installation, which means:

  1. No OAuth Flow - Shopify handles the entire installation process
  2. No Callback Routes - Your app doesn't need /auth/install or /auth/callback endpoints
  3. Scopes in TOML - All scopes are defined in shopify.app.toml, not in your Laravel code
  4. Session Tokens - App Bridge sends session tokens with every request
  5. Token Exchange - Session tokens are exchanged for access tokens via Shopify's API

Authentication Flow

Routes

The package automatically registers these routes:

There are no OAuth routes (/auth/install, /auth/callback) because Shopify manages installation automatically.

Scope Management

Important: Scopes Are Managed by Shopify CLI

This package does not manage scopes in Laravel. All scopes are defined in your shopify.app.toml file and managed by Shopify CLI.

How to Configure Scopes

  1. Edit your shopify.app.toml file:

  2. Deploy via Shopify CLI:

  3. Updating Scopes:

When you change scopes in shopify.app.toml, merchants will be prompted to reapprove your app on their next visit. Shopify handles this automatically.

Common Scopes

Why No SHOPIFY_SCOPES Environment Variable?

In traditional OAuth flows, you'd set scopes in .env:

With Shopify Managed Installation:

Quick Start

Creating a Query

Executing Queries

Creating a Mutation

Paginated Queries

DTOs and Input Objects

This package provides a comprehensive set of Data Transfer Objects (DTOs) and Input objects for working with Shopify entities. All classes are built using Spatie Laravel Data for type safety, validation, and extensibility.

Available Objects

The package includes DTOs and Input objects for common Shopify entities:

Main DTOs - Represent core Shopify resources like Orders, Customers, Products, Metafields, Metaobjects, and Fulfillments. These include all relevant fields and nested objects.

Supporting DTOs - Represent commonly used nested objects such as MailingAddress, MoneyBag, MoneyV2, Weight, LineItem, ShippingLine, TaxLine, DiscountAllocation, and ProductVariant.

Input Objects - Used in GraphQL mutations to create or update Shopify resources. Includes Input objects for Orders, Customers, Products, Metafields, Metaobjects, Fulfillments, and their supporting types.

All objects follow Shopify's GraphQL schema naming conventions exactly (e.g., MailingAddress not Address, MoneyBag not Money) and use camelCase for properties.

Extensibility

All DTOs and Input objects are designed to be extended and overwritten in your Shopify apps. This allows you to:

Example: Extending OrderDto

Example: Using Input Objects in Mutations

All objects use camelCase naming and follow Shopify's GraphQL schema exactly (e.g., MailingAddress not Address, MoneyBag not Money).

Webhooks

Webhooks are registered in your shopify.app.toml file and handled by Laravel jobs. The package includes built-in handlers for app lifecycle and GDPR compliance webhooks.

Built-in Webhook Handlers

These webhook jobs are included and pre-configured:

These handlers log events and provide placeholder methods for you to customize.

1. Register Webhooks in shopify.app.toml

Add webhooks to your shopify.app.toml file:

Important:

2. Map Webhooks to Laravel Jobs

The built-in GDPR and app lifecycle webhooks are already configured in config/shopify.php. The package will automatically dispatch these webhooks to their respective job classes.

3. Add Custom Webhook Handlers

Generate Webhook Job

Use the Artisan command to scaffold a new webhook job:

This creates app/Jobs/Shopify/OrdersCreateJob.php with boilerplate code.

Important: After generating the job, you must:

  1. Register the webhook in your shopify.app.toml file
  2. Add the job mapping to config/shopify.php
Register Webhook in Config

Add your custom webhook handlers to config/shopify.php:

4. Create Custom Webhook Job (Manual)

Events

The package dispatches Laravel events during the app lifecycle that you can listen to:

Event Dispatched From When
AppInstalledEvent Middleware After a new shop record is created
AppReinstalledEvent Middleware After a soft-deleted shop is restored
AppUninstalledEvent AppUninstalledJob After shop is soft-deleted

All events contain the Shop model and are dispatched synchronously (after the database operation succeeds).

Example: Listening to Events

GDPR Compliance

Schedule cleanup of uninstalled shops:

Or run manually:

Middleware

The package includes 8 middleware types for different Shopify surfaces:

Middleware Alias Use Case
VerifyEmbeddedApp shopify.verify.embedded-app Embedded app home (session token auth)
VerifyWebhook shopify.verify.webhook Webhook handlers
VerifyAppProxy shopify.verify.app-proxy App Proxy requests
VerifyAdminUIExtension shopify.verify.admin-ui-extension Admin UI extensions
VerifyPosUIExtension shopify.verify.pos-ui-extension POS UI extensions
VerifyCheckoutUIExtension shopify.verify.checkout-ui-extension Checkout UI extensions
VerifyCustomerAccountUIExtension shopify.verify.customer-account-ui-extension Customer account extensions
VerifyFlowAction shopify.verify.flow-action Shopify Flow actions

All middleware automatically:

Security Features:

Architecture

Design Principles

  1. Shopify Managed Installation: Installation and scope management delegated to Shopify CLI
  2. Session Token Authentication: Modern token exchange (no OAuth callbacks)
  3. Offline Tokens by Default: Uses offline access tokens (never expire) for background operations
  4. Soft Deletes: Shops are soft-deleted on uninstall for GDPR compliance and reinstallation support
  5. Facade Pattern: All access via Shopify::query() - no direct client instantiation
  6. Type Safety: GraphQL queries/mutations are typed via contracts
  7. Queue Routing: Webhooks route to specific queues (e.g., GDPR on separate queue)

Advanced Usage

Shop Model

Logging

Control what gets logged in config/shopify.php:

Testing

Run the test suite:

Run code style checks:

License

This package is open-sourced software licensed under the MIT license.

Credits


All versions of laravel-shopify with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^11.40|^12.0|^13.0
illuminate/database Version ^11.40|^12.0|^13.0
illuminate/http Version ^11.40|^12.0|^13.0
illuminate/contracts Version ^11.40|^12.0|^13.0
shopify/shopify-app-php Version ^0.1
spatie/laravel-data Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package esign/laravel-shopify contains the following files

Loading the files please wait ...