Download the PHP package garmanio/laravel-shopify without Composer

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

An easy-to-use PHP package to communicate with Shopify's API in Laravel.

Installation

Require garmanio/shopify in composer.json

Add "garmanio/shopify" in your "require" object. With a blank Laravel install, it will look something like this:

For Laravel 5, use "garmanio/shopify": "~3.0"

Add the Service Provider

In app/config/app.php, add GarmanIO\Shopify\ShopifyServiceProvider to the end of the providers array.

Setting Up

To begin, use App::make() to grab an instance of the API class.

Loading API Credentials

Simply pass an array with the following keys (and filled-in values) to prepare. Not all values need to be passed at once; you can call the setup() method as many times as you'd like; it will only accept the following 4 keys, and overwrite a values if it's already set.

Shortcut:

Pass the setup array as the second argument in App::make():

That's it! You're ready to make some API calls.

Finding the Install URL

After setting up with at least SHOP_DOMAIN & API_KEY, call installURL() with an array of permissions (the app's Scope):

You may also pass a redirect URL per the redirect_uri parameter as described by the Shopify API Docs

Authentication / Getting OAuth Access Token

In order to make Authenticated requests, the Access Token must be passed as a header in each request. This package will automatically do that for you, but you must first authenticate your app on each store (as the user installs it), and save the Access Token.

Once the user accesses the Install URL and clicks the Install button, they will be redirected back to your app with data in the Query String.

After setting up with at least SHOP_DOMAIN, API_KEY, & API_SECRET, call getAccessToken() with the code passed back in the URL. Laravel makes this easy:

Verifying OAuth Data

Shopify returns a hashed value to validate the data against. To validate (recommended before calling getAccessToken()), utilize verifyRequest().

verifyRequest() returns TRUE when data is valid, otherwise FALSE. It throws an Exception in two cases: If the timestamp generated by Shopify and your server are more than an hour apart, or if the argument passed is not an array or URL-encoded string of key/values.

If you would like to skip the timestamp check (not recommended unless you cannot correct your server's time), you can pass TRUE as a second argument to verifyRequest() and timestamps will be ignored:

Private Apps

The API Wrapper does not distinguish between private and public apps. In order to utilize it with a private app, set up everything as you normally would, replacing the OAuth Access Token with the private app's Password.

Calling the API

Once set up, simply pass the data you need to the call() method.

call() Parameters

The parameters listed below allow you to set required values for an API call as well as override additional default values.

Some Examples

Assume that $sh has already been set up as documented above.

Listing Products

$call will either contain a stdClass object with products or an Exception error message.

Creating a snippet from a Laravel View

Performing operations on multiple shops

The setup() method makes changing the current shop simple.


All versions of laravel-shopify with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ~5.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 garmanio/laravel-shopify contains the following files

Loading the files please wait ....