Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Xerobundle Laravel Package

blackoptic/xerobundle

Symfony bundle that wraps the Xero API with a Guzzle-based client. Configure your Xero consumer key/secret and private key, then fetch resources like Invoices via the blackoptic.xero.client service for simple authenticated requests.

View on GitHub
Deep Wiki
Context7

Symfony2 Bundle that creates an Guzzle client for Xero

Frequently asked questions about Xerobundle
Can I use BlackOptic/XeroBundle in Laravel, or is it only for Symfony2?
This bundle is designed for Symfony2 and won’t work natively in Laravel. For Laravel, consider alternatives like the official Xero PHP SDK or a custom Guzzle wrapper. If you’re tied to Symfony2, this bundle is a solid choice for Xero API integration.
What Laravel version does BlackOptic/XeroBundle support?
This bundle does not support Laravel directly—it’s built for Symfony2. If you’re using Laravel 5.5+, you’ll need to either fork the bundle for Laravel compatibility or use a standalone Guzzle client with Xero’s OAuth2 library.
How do I securely store my Xero private key in production?
Never hardcode private keys in config files. Use environment variables (e.g., `.env` in Laravel) or a secrets manager like AWS Secrets Manager, HashiCorp Vault, or Laravel’s built-in encryption for sensitive credentials.
Does BlackOptic/XeroBundle handle Xero API rate limits automatically?
The bundle doesn’t include built-in rate limit handling, but you can implement retries with exponential backoff using Guzzle middleware. For high-frequency requests, consider caching responses or using Xero’s API batch endpoints.
What’s the best way to test Xero API calls with this bundle?
Mock the `blackoptic.xero.client` service in your tests using Symfony’s DI container or Laravel’s service container. For Laravel, you may need to create a custom wrapper service that mimics the bundle’s interface for testing.
Will this bundle work with Laravel’s service container?
No, this bundle is tightly coupled to Symfony2’s service container. For Laravel, you’d need to manually register the Guzzle client and OAuth2 logic or adapt the bundle’s codebase to Laravel’s container (e.g., using Laravel’s `bind()` method).
Are there alternatives to BlackOptic/XeroBundle for Laravel?
Yes. For Laravel, consider the official [Xero PHP SDK](https://github.com/XeroAPI/xero-php), which supports Laravel natively, or build a custom Guzzle client with the [xero-php/oauth2](https://github.com/XeroAPI/xero-php-oauth2) library.
How do I handle OAuth2 token refreshes with this bundle?
The bundle automates OAuth2 authentication, but token refreshes depend on Xero’s API. If tokens expire, the bundle will throw an exception. Implement a retry mechanism or listen for `401 Unauthorized` errors to refresh tokens programmatically.
Does BlackOptic/XeroBundle support Xero’s newer API endpoints (e.g., v3)?
The bundle’s compatibility with Xero API versions depends on its last update. Check the [GitHub repository](https://github.com/james75/XeroBundle) for version support. If it lacks v3 support, you may need to extend the bundle or use Xero’s official SDK.
How do I log Xero API responses for debugging in Laravel?
Since this bundle isn’t Laravel-native, intercept the Guzzle client’s responses by extending the service or wrapping it in a Laravel middleware. Use Laravel’s logging facade (`Log::debug()`) to log requests/responses for debugging.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle