Download the PHP package portside-labs/laravel-shopify without Composer

On this page you can find all versions of the php package portside-labs/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

A starter kit for building embedded Shopify apps the Laravel way.

You get a working embedded app on Laravel, Inertia, and React whose pages are composed from Shopify's Polaris web components, so they look and behave like the rest of the Shopify admin. Authentication is an ordinary Laravel guard, Shopify's Admin API is a method away on your models, and webhooks are queued jobs. There is no OAuth redirect dance and no custom middleware to maintain.

What's included

Requirements

Getting started

1. Create your project

Composer generates the application key, creates the SQLite database, and runs the migrations. You can also use the Laravel installer: laravel new my-app --using=portside-labs/laravel-shopify.

2. Create the app in Shopify

Create an app in the Dev Dashboard and copy its client ID and client secret into .env:

3. Link and deploy the app configuration

shopify.app.toml declares that the app is embedded, uses Shopify managed installation, and subscribes to its webhooks. Connect it to your app:

The CLI rewrites the file from Shopify's copy of the configuration, so check that the [build] section and both [[webhooks.subscriptions]] blocks survived (restore them from git if not), then set the access scopes your app needs and release the configuration so Shopify subscribes to the webhooks:

Keep use_legacy_install_flow = false: the kit relies on managed installation and does not implement the legacy authorization code grant.

4. Run the app

The CLI opens an HTTPS tunnel, starts the Laravel server, queue worker, and Vite (composer run dev), updates the app's URLs in Shopify, and prints a link to open the app in your development store. Opening it installs the app; the first request exchanges the ID token for access tokens and the home page renders.

To use your own HTTPS URL instead of the CLI's tunnel, set APP_URL to it and pass it along with shopify app dev --tunnel-url=https://your-host:443.

How it works

Authentication

Shopify opens the app inside the admin with an id_token query parameter, and App Bridge attaches a fresh ID token to every request the frontend makes. App\Shopify\IdTokenGuard verifies the token's signature and claims, then resolves the shop and the staff member from it. The first time a shop is seen it is installed by exchanging the token for an offline access token, and the first time a staff member is seen their profile and online token are recorded the same way. Both are ordinary Eloquent models: App\Models\Shop and App\Models\User.

Pages opened without a valid token are redirected to a small bounce page that lets App Bridge fetch a new token and reload. Requests from the frontend are answered with a 401 that App Bridge and the app's own handler know to retry.

Calling the Admin API

Shop::api() acts as the shop and refreshes the expiring token when needed. User::api() acts as the staff member, limited to their own permissions in the admin. Both return a client whose graphql() method wraps Laravel's HTTP client, so Http::fake() works in tests.

Webhooks

Shopify delivers every webhook to /webhooks. App\Http\Middleware\VerifyShopifyWebhookSignature checks the signature, and App\Http\Controllers\WebhookController dispatches the job mapped to the topic in config/shopify.php. To handle a new topic, subscribe to it in shopify.app.toml, map it to a job in the config file, and run shopify app deploy. Jobs receive the Shop and the payload:

Sessions inside the admin

Authentication never depends on cookies. The session is only used for Inertia's validation errors and flash data, and its cookie is configured as SameSite=None; Secure; Partitioned so browsers accept it inside the admin's iframe.

The frontend

resources/js/app.tsx attaches the ID token to every Inertia request, routes clicks on the admin sidebar (<s-app-nav>) through Inertia, mirrors visits on the admin's loading bar, and shows flash data as toasts: Inertia::flash('toast', 'Saved.') from any controller becomes a native admin toast. Types for the web components come from @shopify/polaris-types and @shopify/app-bridge-types, and the shopify global exposes the App Bridge APIs. Server-side rendering is disabled: the app renders for signed-in merchants inside the admin, and App Bridge and Polaris only run in the browser.

Translations

The language files in lang/ are the only place a string is written. __('home.title') reads them on the server, and the same catalog is shared with the frontend once per page load, where react-i18next reads it with the same keys, the same :placeholder syntax, and the same singular|plural forms:

Shopify names the staff member's admin language in the locale parameter when it loads the app. App\Http\Middleware\SetLocale matches it to the locales listed in app.locales in config/app.php, remembers it on the user, and sets the application locale for the request; User::preferredLocale() gives their mail and notifications the same language. To add a language, translate the files into lang/{locale} and add the locale to app.locales. Keys a translation is missing fall back to the fallback locale, entry by entry.

Billing with Shopify App Pricing

Plans are configured in the Partner Dashboard and sold by Shopify, so the kit contains no billing API calls of its own; it only asks Shopify which plan a shop is on. Set the app's handle and ID, and create a Partner API client with the "Manage apps" permission:

Then add the subscribed middleware to the routes a plan pays for, or subscribed:pro to require one plan in particular:

A shop without a plan is sent to /pricing, which opens the plan selection page Shopify hosts in the admin. Once the merchant has approved a plan, Shopify sends them to the plan's welcome link, so set it to /billing/welcome on each plan in the Partner Dashboard; the app confirms the subscription with Shopify and shows a toast. Shop has a Cashier-like API for everything else:

Shopify sends no webhook when a subscription changes, so the answer is kept on the shop for five minutes and read from the Partner API again after that, which is how cancellations are noticed. Development stores in your Partner organization can take any plan for free while you test. Usage-based charges are reported through Shopify's App Events API, which the kit leaves to you.

Building your app

Deploying

Working with AI agents

CLAUDE.md describes the kit's conventions for Claude Code, including the rule that pages are built only from Polaris web components. .mcp.json registers the Shopify Dev MCP server so the agent can consult Shopify's documentation, and Laravel Boost provides the Laravel-specific tooling.

License

The Laravel Shopify starter kit is open-sourced software licensed under the MIT license.


All versions of laravel-shopify with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
inertiajs/inertia-laravel Version ^3.0
laravel/framework Version ^13.17
laravel/tinker Version ^3.0
laravel/wayfinder Version ^0.1.14
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 portside-labs/laravel-shopify contains the following files

Loading the files please wait ...