Download the PHP package blockshiftnetwork/sapb1-client without Composer

On this page you can find all versions of the php package blockshiftnetwork/sapb1-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sapb1-client

SAP B1 Client for Laravel

Latest Version on Packagist Total Downloads

A robust, production-grade Laravel package for SAP Business One HTTP integration, supporting multiple connections, fluent OData queries, and both standard and custom Service Layer endpoints.

Requirements

Installation

You can install the package via composer:

Publish the config file:

Configuration

The package supports multiple named connections, each with its own server, credentials, and isolated session management. Add your credentials to .env:

The published config file (config/sapb1-client.php):

You can add as many connections as you need. Each connection maintains its own session independently.

Usage

Multiple Connections

The package works like Laravel's DB::connection(). The SapB1 facade resolves to a connection manager that lazily creates client instances per named connection.

Fluent Query Builder

The query() method returns a fluent builder for full CRUD operations on any SAP entity.

Listing records

Finding a single record

Creating a record

Updating a record

When updating documents with collection properties like DocumentLines, use replaceCollections: true to send the B1S-ReplaceCollectionsOnPatch header. Without it, SAP merges lines instead of replacing them.

Deleting a record

Query builder on named connections

All query builder methods work on any connection:

OData Queries with Array Syntax

You can also pass raw OData parameters as an array:

Or build them with the standalone ODataQuery class:

Supported Operators

The where and orWhere methods support these operators:

Operator Description Example
=, eq Equal ->where('CardType', '=', 'cCustomer')
!=, ne Not Equal ->where('Status', '!=', 'Inactive')
>, gt Greater Than ->where('Balance', '>', 1000)
>=, ge Greater Than or Equal ->where('Stock', '>=', 10)
<, lt Less Than ->where('DocTotal', '<', 500)
<=, le Less Than or Equal ->where('Discount', '<=', 15)
contains String Contains ->where('CardName', 'contains', 'Shop')
startswith String Starts With ->where('ItemCode', 'startswith', 'A')
endswith String Ends With ->where('Address', 'endswith', 'USA')
in In Array ->where('GroupCode', 'in', [1, 2, 5])
notin Not In Array ->where('Country', 'notin', ['US', 'CA'])
between Between two values ->where('DocDate', 'between', ['2024-01-01', '2024-01-31'])

For very specific or complex filters not covered above, pass a Filter instance directly: ->where(new Raw("substring(CardName, 1, 3) eq 'ABC'"))

Custom Headers and SML Requests

File Uploads and Custom Requests

For scenarios like file uploads or other complex requests, use sendRequestWithCallback for direct access to the configured HTTP client:

Direct HTTP Methods

All standard HTTP methods are available on any connection:

Concurrent Requests with Pool

Execute multiple requests concurrently for better performance:

You can also use POST, PUT, PATCH, DELETE in the pool:

Http Macro

You can also create a one-off client with explicit config using the Http::SapB1() macro:

Explicit Logout

Laravel Octane Compatibility

The package is fully compatible with Laravel Octane. The SapB1Manager is registered as a singleton and automatically resets request-specific state (headers, retry flags) at the start of each Octane request. Session cookies are managed via Laravel's cache and are not affected by the reset.

Testing

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of sapb1-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package blockshiftnetwork/sapb1-client contains the following files

Loading the files please wait ...