Git Product home page Git Product logo

netsuite-laravel's Introduction

netsuite-laravel

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.

netsuite-laravel's People

Contributors

jrebs avatar sircoolness avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

netsuite-laravel's Issues

Class "Netsuite\Classes\GetPostingTransactionSummaryRequest" not found

I am trying to use the GetPostingTransactionSummaryRequest and I am getting the error below.

$service = app(NetSuiteService::class);
$request = new GetPostingTransactionSummaryRequest();

The challenge is that the GetPostingTransactionSummaryRequest is in the vendor NetSuite folder but not able to call it. Is there anything I may be missing? Thanks.

Screenshot 2023-05-04 at 14 40 55

cant publish NetsuiteServiceProvider

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

ends in the message "Unable to locate publishable resources"

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

I get this message: Target class [App\Http\Controllers\NetSuite\NetSuiteService] does not exist.

can you help please

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.