Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [1.1.2] - 2026-09-03

### Changed

- Added positional path identifiers and direct body, query, and multipart arrays to all 220 generated methods while preserving the complete published 1.1.0 envelope and named-argument surface.
- Updated the generated catalog and public examples to hide internal transport envelopes and execute the documented ergonomic calls.

## [1.1.1] - 2026-09-03

### Added
Expand Down Expand Up @@ -65,7 +72,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Latest baseline whose public API is explicitly preserved by 1.1.0.


[Unreleased]: https://github.com/fleetbase/fleetbase-php/compare/1.1.1...HEAD
[Unreleased]: https://github.com/fleetbase/fleetbase-php/compare/1.1.2...HEAD
[1.1.2]: https://github.com/fleetbase/fleetbase-php/compare/1.1.1...1.1.2
[1.1.1]: https://github.com/fleetbase/fleetbase-php/compare/1.1.0...1.1.1
[1.1.0]: https://github.com/fleetbase/fleetbase-php/compare/1.0.3...1.1.0
[1.0.3]: https://github.com/fleetbase/fleetbase-php/compare/1.0.2...1.0.3
Expand Down
45 changes: 33 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,31 @@ Never commit an API key. Load it from your runtime secret manager or environment

Existing property access remains supported (`$fleetbase->orders`). Explicit accessors such as `$fleetbase->orders()` are available for static analysis and dependency injection. Browse [all 220 generated PHP examples](docs/api-examples.md); CI executes each exact snippet against a hermetic transport.

### Endpoint arguments

Generated endpoint methods use the resource identifiers that appear in the URL as positional arguments, followed by the API data and optional request options. Body and query fields are passed directly; callers do not need to know the SDK's internal `body` or `query` transport keys.

```php
$driver = $fleetbase->drivers->changeDriverPassword($driverId, [
'current_password' => $currentPassword,
'password' => $newPassword,
'password_confirmation' => $newPassword,
'device_name' => 'navigator',
]);

$order = $fleetbase->orders->scheduleOrder($orderId, [
'date' => '2026-09-10',
'time' => '8am',
'timezone' => 'Asia/Singapore',
]);

$manifests = $fleetbase->drivers->listDriverManifests($driverId, [
'page' => 1,
]);
```

Methods with two URL identifiers take both identifiers before the data array, for example `capturePhotoForOrder($orderId, $subjectId, $data, $requestOptions)`. Collection methods take data first and request options second. The published 1.1.0 envelope form remains supported, including named `parameters:` and `options:` arguments, but new documentation uses the positional/direct form.

## Configuration

The second constructor argument accepts client configuration. The third legacy argument retains the debug flag without printing requests or credentials.
Expand Down Expand Up @@ -148,20 +173,16 @@ Exception URLs are sanitized and never include credentials or query strings. Avo
Multipart actions accept standard Guzzle multipart parts. The Core file service also exposes the official base64 upload action.

```php
$file = $fleetbase->files->uploadFile([], [
'multipart' => [
[
'name' => 'file',
'contents' => file_get_contents('/path/to/document.pdf'),
'filename' => 'document.pdf',
],
['name' => 'path', 'contents' => 'documents'],
$file = $fleetbase->files->uploadFile([
[
'name' => 'file',
'contents' => file_get_contents('/path/to/document.pdf'),
'filename' => 'document.pdf',
],
['name' => 'path', 'contents' => 'documents'],
]);

$contents = $fleetbase->files->downloadFile([
'id' => 'file_123',
]);
$contents = $fleetbase->files->downloadFile('file_123');
```

Non-JSON successful responses are returned as strings. The underlying PSR-7 response is available from `$fleetbase->client->getLastPsrResponse()` when headers or streaming behavior are needed.
Expand All @@ -172,7 +193,7 @@ Retries are opt-in. GET, HEAD, OPTIONS, PUT, and DELETE requests may retry on tr

```php
$order = $fleetbase->orders->createOrder(
['body' => $attributes],
$attributes,
[
'idempotency_key' => $operationId,
'max_retries' => 2,
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
"api:compatibility": [
"@api:snapshot",
"@php tools/check-api-compatibility.php --baseline=contracts/public-api-1.0.2.json --current=build/contracts/public-api-current.json",
"@php tools/check-api-compatibility.php --baseline=contracts/public-api-1.0.3.json --current=build/contracts/public-api-current.json"
"@php tools/check-api-compatibility.php --baseline=contracts/public-api-1.0.3.json --current=build/contracts/public-api-current.json",
"@php tools/check-api-compatibility.php --baseline=contracts/public-api-1.1.0.json --current=build/contracts/public-api-current.json"
],
"check": [
"@lint",
Expand Down
Loading
Loading