PHP code example of nguyentn / netsuite-laravel

1. Go to this page and download the library: Download nguyentn/netsuite-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nguyentn / netsuite-laravel example snippets


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

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

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

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);
    }
}

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