calcinai/xero-php
PHP client library for the Xero API with Guzzle-based requests and ORM-like models. Supports OAuth 2 authorization code flow, access/refresh tokens, and multi-tenant (organisation) access via tenantId. Install via Composer and query Xero resources via XeroPHP\Application.
Pros:
history trait for BatchPayment and ManualJournal models enables audit logging or versioning without custom code, aligning with Laravel’s Eloquent conventions.BadRequestException and NotFoundException now include raw responses (PR #933, #934), aiding debugging and custom error mapping in Laravel.Contacts.All with where clauses).@return annotations (PR #941) and nullable parameter fixes improve IDE support and static analysis (e.g., PHPStan, Psalm).Details property for Payment models (PR #938) expands functionality for use cases requiring granular payment data (e.g., reconciliation).Cons:
Laravel Integration Paths (Unchanged):
Key Dependencies (Updated):
vlucas/phpdotenv or similar is used for .env config.Data Mapping (Updated):
Contact models with boolean fields (e.g., IsSupplier).%20 vs. +), critical for dynamic filters.High:
App\Exceptions\Handler).Medium:
BatchPayment or ManualJournal frequently.Low:
App\Exceptions\Handler be updated to leverage raw responses in BadRequestException?history trait for BatchPayment/ManualJournal? Is it customizable?history trait or search fixes?BatchPayment tracking).Payments.All with Details).history trait for a BatchPayment model and test audit logging.%20 in contact names).composer.json to require calcinai/xero-php:^2.8.0.public function render($request, Throwable $exception) {
if ($exception instanceof \Calcinai\XeroPhp\Exceptions\BadRequestException) {
Log::error('Xero API Error', ['response' => $exception->getResponse()]);
}
return parent::render($request, $exception);
}
BatchPayment):
use Calcinai\XeroPhp\Models\BatchPayment;
BatchPayment::saved(function ($model) {
Log::info('BatchPayment updated', ['id' => $model->Id, 'history' => $model->history]);
});
%20 encoding for spaces.composer.json).Details property in Payment models (PR #938).php-curl, php-json, and now implicitly php-8.4 for full support.BadRequestException.history trait for BatchPayment/ManualJournal and test audit logs.%20 encoding (PR #940).How can I help you explore Laravel packages today?