julzlegaspi / odataclient
SAP B1 OData Client
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- saintsystems/odata-client: ^0.7.4
README
composer require julzlegaspi/odataclient
Publish Provider
php artisan vendor:publish --provider="Julzlegaspi\Odataclient\ODataClientServiceProvider"
Add to .env file
SAP_DB=your_sap_b1_database_name
SAP_USER=your_sap_b1_username
SAP_PASSWORD=your_sap_b1_password
SAP_PATH=https://xxx.xxx.xxx.xxx:50000/b1s/v1
VERIFY_SSL=true //change to false if using self-signed SSL
Usage
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Julzlegaspi\Odataclient\SAPODataClient;
class TestController extends Controller
{
public function index()
{
$odata = new SAPODataClient;
// Get lists of orders
$results = $odata->getOdataClient()
->from('Orders')
->get();
dd($results);
// Get order by id
$result = $odata->getOdataClient()
->from('Orders')
->find(1);
dd($result)
// Update order by id
$result = $odata->getOdataClient()
->from('Orders')
->whereKey(1)
->patch([
'key' => 'value'
]);
}
}