Download the PHP package litvinjuan/laravel-shopify without Composer

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

Connect your Laravel application to the Shopify API

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Installation

You can install the package via composer:

You can publish and run the migrations with:

You can publish the config file with:

Setup

The package comes with a default Shop model that you can use. However, if you want to add extra properties or relationships, you'll need to create your own Shop model that implements the ShopContract interface and uses the ShopTrait trait.

Note: Remember to also modify the migration before running it to add any additional columns you may need

Then, you have to add your shop model to the package configuration. Publish the configuration if you haven't (using the command in the Installation section) and change the shop-model value to your own model:

The next step to set up our Shop owner, which is the model that's related to your shop. Right now, we only support the user as the owner, so go into your User model and add the following interface:

Now, there's two ways in which you can relate your users and shops.
If you want each user to only have one shop, then you should the HasShop trait. If you want each user to own multiple shops, meaning that one user has access to many shops, use the HasShops trait.

Note: only include one trait in your model

Once your user model is set up, go into the configuration file once again and change the user-model value to your own model

The last step is to implement the ShopLoader. This is a class that will tell shopify how to determine which shop to use during requests. Below is an example of a ShopLoader that works for a user that only has one shop, and simply tells shopify to use the shop of the current authenticated user:

Once you've implemented your own ShopLoader, or used the own provided above, you'll need to add it to the shopify configuration file:

Lastly, you'll need to create an App in your Shopify Developer account, and set up the following variables in your .env file:

SHOPIFY_API_KEY= This is your app's api key. You can find it in your app dashboard
SHOPIFY_API_SECRET= This is your app's api secret. You can find it in your app dashboard
SHOPIFY_API_SCOPES= If no scopes are provided during an authentication request, shopify will use these.
SHOPIFY_API_CALLBACK_URL= Callback url to use after the user has installed the app on shopify. Remember to whitelist this URL in your app dashboard.

Usage

This package adds a few things to your laravel application.

First, you have a new middleware signed.shopify, which verifies that the request is coming from shopify and has a valid signature. Include this middleware in any webhook routes or other requests where you want to verify that the request came from Shopify.

There's also a new Shopify authentication guard, which allows you to authenticate a user when they are viewing your app within the Shopify Admin Panel. You should use this auth guard for any routes that the user may access from within the Shopify Admin Panel, and not through your own website.

Authentication

To authenticate your users in Shopify, you'll need to add two routes: one to redirect the user to Shopify's Oauth screen, and one for the callback from that screen:

In your redirect route, you'll need to receive a shop domain parameter for the Shopify store your user wants to connect to. Then, simply redirect them with the following:

After the user accepts the scopes and installs the app on their Shopify store, they'll be redirected back to your callback url. The last step, is to configure the callback to generate the necessary access token for the shop:

You can also pass a different callback url or scopes as the third and fourth arguments to the redirect method

To interact with the Shopify Api, simply call the api() method in the shop you want to use, and hit the endpoint you want to use

Shopify Facade

The package makes a Shopify Facade available that has a few useful methods.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-shopify with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4
illuminate/database Version ^8.0
illuminate/support Version ^8.0
illuminate/http Version ^8.0
ext-json Version *
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 litvinjuan/laravel-shopify contains the following files

Loading the files please wait ....