joymendonca/shopify-oauth-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

joymendonca/shopify-oauth-laravel

最新稳定版本:v1.0.9

Composer 安装命令:

composer require joymendonca/shopify-oauth-laravel

包简介

A simple package to make Shopify App Oauth easy.

README 文档

README

This package provides a convenient way to integrate Shopify OAuth authentication into your Laravel application. It simplifies the process of setting up OAuth with Shopify, allowing you to focus on building your application's features rather than dealing with the intricacies of authentication.

Installation

You can install this package via Composer. Run the following command in your terminal:

composer require joymendonca/shopify-oauth-laravel

Configuration

After installing the package, you'll need to publish and run the migrations with:

php artisan vendor:publish --tag="shopify-oauth-laravel-migrations"
php artisan migrate

You can also publish the config file using:

php artisan vendor:publish --tag="shopify-oauth-laravel-config"

You will now need to setup the environment variables in your .env file:

APP_URL="https://your-website.com"                    #The base url for your website
SHOPIFY_CLIENT_ID="your-shopify-client-id"            #Shopify App Client ID
SHOPIFY_CLIENT_SECRET="your-shopify-client-secret"    #Shopify App Client Secret
SHOPIFY_SCOPES="read_products,write_products"         #Shopify App Scopes Needed
SHOPIFY_APP_HOME_URL='/'                              #URL you want the user to get redirected to when the launch the app

You can register the routes using the code below in web.php:

use joymendonca\ShopifyOauthLaravel\ShopifyOAuthLaravelRoutes;

ShopifyOAuthLaravelRoutes::register();

Make sure the app install url registered in your shopify app is "https://your-website.com/shopify-app-auth/install" and the redirect url is "https://your-website.com/shopify-app-auth/load"

Usage

Once the package is installed and configured, you can start using Shopify OAuth in your Laravel application.

You can get the access token and store url of the logged in as below:

use joymendonca\ShopifyOauthLaravel\Facades\ShopifyOauthLaravel;

$access_token = ShopifyOauthLaravel::getStoreAccessToken();
$store_url = ShopifyOauthLaravel::getStoreUrl();

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 662
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-16