Coder Social home page Coder Social logo

laravel-jd-logistic's Introduction

laravel-jd-logistic

Laravel 5 京东物流接口

Installation

The ActionLog Service Provider can be installed via Composer by requiring the arthuryinzhen/laravel-jd-logistic package and setting the minimum-stability to dev (required for Laravel 5) in your project's composer.json.

{
    "require": {
           "arthuryinzhen/laravel-jd-logistic": "dev-master"
    },
   
}

or

Require this package with composer:

composer require arthuryinzhen/laravel-jd-logistic dev-master

Update your packages with composer update or install with composer install.

Usage

To use the ActionLog Service Provider, you must register the provider when bootstrapping your Laravel application. There are essentially two ways to do this.

Find the providers key in config/app.php and register the ActionLog Service Provider.

    'providers' => [
        // ...
        
        'Arthuryinzhen\JDLogistic\JDLogisticServiceProvider',
    ]

for Laravel 5.1+

    'providers' => [
        // ...
        Arthuryinzhen\JDLogistic\JDLogisticServiceProvider::class,
    ]

Find the aliases key in config/app.php.

    'aliases' => [
        // ...
        'JDLogistic' => 'Arthuryinzhen\JDLogistic\Facades\JDLogisticFacade',
    ]

for Laravel 5.1+

    'aliases' => [
        // ...
        'JDLogistic' => Arthuryinzhen\JDLogistic\Facades\JDLogisticFacade::class,
    ]

Configuration

To use your own settings, publish config.

$ php artisan vendor:publish

config/JdLogistic.php

	'client' => [
            'appKey'      => env('JD_CLIENT_APP_KEY', '26EAC2509056EB38FB623D9A49296D2C'),
            'appSecret'   => env('JD_CLIENT_APP_SECRET', '1abdc5a97ecb4594ab7b772296bcfbbd'),
            'accessToken' => env('JD_CLIENT_ACCESS_TOKEN', '1f1d3048-220a-484d-ad93-f3808d9aacc1'),
            'serverUrl'   => env('JD_CLIENT_SERVER_URL', 'https://api.jd.com/routerjson'),
        ],

Last Step

modify you .env

JD_CLIENT_APP_KEY=
JD_CLIENT_APP_SECRET=
JD_CLIENT_ACCESS_TOKEN=
JD_CLIENT_SERVER_URL="https://api.jd.com/routerjson"

Demo

public function getTest(Request $request)
{
    $array = $request->input();
    $lotus = new JDLogisticRepository();
    $result = $lotus->ldopWaybillReceiveRequest($array);
    dd($result);
}

laravel-jd-logistic's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.