承接 netsuitephp/netsuite-laravel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

netsuitephp/netsuite-laravel

最新稳定版本:v1.0

Composer 安装命令:

composer require netsuitephp/netsuite-laravel

包简介

NetSuite PHP laravel provider wrapper

README 文档

README

License

A PHP supplemental package to the ryanwinchester/netsuite-php package to add the NetSuite service client to the service container of a Laravel application. This package should be considered to be beta software for the time being.

Installation

composer require netsuitephp/netsuite-laravel

Configuration

By default, the configuration will assume you have your $_ENV populated with netsuite configuration keys laid out in the netsuite-php package. Read the included config/netsuite.php file as it is documented with inline comments.

Go to the netsuite-php quickstart section for more details. You can jump directly to the .env.example file to save time.

Publishing the config file

If for whatever reason you don't want to use the .env method of configuring the NetSuite service in your application, you can also publish the provided config file into your Laravel application and modify it as desired.

php artisan vendor:publish --provider=NetSuite\\Providers\\NetSuiteServiceProvider

Usage

Once installed, you should be able to access the netsuite service in the usual ways that you might get an object from the service container, either by the full service class name or using the alias provided, or by using the provided Facade, if preferred.

Get from the service container using the long form method

$service = app(NetSuite\NetSuiteService::class);
$response = $service->get($request);

Get from the service container using the alias

$service = app('netsuite');
$response = $service->get($request);

Get from the Facade accessor

$response = NetSuite::get($request);

Dependency Injection

You can also use Laravel's dependency injection. This imaginary Http controller provides a theoretical demonstration.

namespace App\Http\Controllers;

use NetSuite\Classes\GetRequest;
use NetSuite\Classes\RecordRef;
use NetSuite\Classes\RecordType;
use NetSuite\NetSuiteService;

class LookupController extends Controller
{
    public function lookupCustomer(NetSuiteService $service, int $internalId)
    {
        $request = new GetRequest();
        $request->baseRef = new RecordRef();
        $request->baseRef->type = RecordType::customer;
        $request->baseRef->internalId = $internalId;
        $response = $service->get($request);
    }
}

Support

If you need help with this package you can use the netsuite-php project's discussions area to look for help or if you believe you have discovered a bug, please report it in this package's issues area.

统计信息

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

GitHub 信息

  • Stars: 11
  • Watchers: 3
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2021-04-16