- What is setono/budbee-php-sdk used for?
- It is a PHP SDK that wraps the Budbee delivery API so you can talk to Budbee from your own code without hand-rolling HTTP requests and response parsing. Typical use cases are creating shipments for orders, retrieving available delivery options for a postcode, and tracking parcels. The SDK is framework agnostic, so it works in plain PHP projects as well as Laravel applications. It is a client library, not a Laravel package that ships routes, migrations, or admin screens.
- How do I install setono/budbee-php-sdk?
- Install it with Composer by running composer require setono/budbee-php-sdk in the root of your project. Composer will resolve the SDK and its HTTP client dependencies and register the autoloader. Because it is a library, there is nothing else to publish or migrate. Commit your composer.json and composer.lock changes so other environments get the same version.
- Does this package work with Laravel?
- Yes, it installs through Composer and its classes are autoloaded like any other dependency, so you can type-hint the client in controllers, jobs, or services and let Laravel's container resolve it. Since the package is not Laravel specific, there is no service provider, facade, or config file to publish by default. Most teams register a small singleton binding in a service provider that constructs the client with credentials from config or env. Laravel version compatibility then depends mainly on the PHP version your application runs rather than on the framework itself.
- How do I configure Budbee API credentials with this SDK?
- You pass your Budbee API credentials to the client when you instantiate it, typically an API key or token pair issued by Budbee for your account. Keep those values out of source control by storing them in environment variables and reading them through config in Laravel. If you need to point at a sandbox or test environment, check the client constructor for a base URL or environment option. Never hard-code production credentials in a repository.
- Can I create shipments, get delivery options, and track parcels with it?
- Those are the core operations the SDK is built around: creating shipments for orders, fetching the delivery options Budbee offers for a destination, and tracking parcels through their lifecycle. The SDK translates these calls into typed methods so you do not have to build URLs or encode payloads yourself. Exact method names and required fields are documented in the package README and mirror the underlying Budbee API. Always validate the response objects before persisting IDs or statuses in your database.
- How do I test code that uses the Budbee SDK?
- Because the SDK performs HTTP calls, the usual approach is to wrap it behind your own interface or service class and mock that in your tests. For integration-style tests you can inject an HTTP client or handler that returns recorded Budbee responses, avoiding real network traffic in CI. Keep a few fixture payloads for shipment creation, delivery options, and tracking so your mapping logic is covered. This keeps your test suite fast and independent of Budbee availability.
- What happens when the Budbee API returns an error or times out?
- The SDK surfaces API errors as exceptions, so wrap calls in try/catch blocks and handle validation failures separately from transport problems such as timeouts or connection resets. For shipment creation in particular, log the request context and avoid blind retries that could create duplicate shipments. Queue non-critical calls so a slow Budbee response does not block a customer checkout. A circuit breaker or backoff strategy is worth adding if you call the API on every order.
- Which PHP and Laravel versions does setono/budbee-php-sdk support?
- Support is defined by the require constraints in the package's composer.json, so check those before upgrading PHP or Laravel. Since the SDK is framework agnostic, Laravel compatibility generally follows from your PHP version and Composer resolution rather than from Laravel-specific code. Run composer why-not setono/budbee-php-sdk if installation conflicts with other dependencies. Pin a known-good version in composer.lock and test upgrades in staging.
- What are alternatives to using this SDK?
- You can call the Budbee REST API directly with Laravel's HTTP client or Guzzle and keep full control over requests, retries, and logging. Other options are an official Budbee SDK if one exists for PHP, or a logistics integration layer that already supports multiple carriers. This SDK is a good fit when you want a thin, Composer-installable wrapper without adding a larger shipping platform. Compare maintenance activity and API coverage before committing.
- Who maintains setono/budbee-php-sdk and is it actively maintained?
- The package is published by Setono under the setono vendor namespace and is distributed through Packagist. Check the repository's commit history, open issues, and release tags to judge how actively it tracks Budbee API changes. Because the underlying API can change, review the changelog before upgrading and keep a fallback plan for calling the API directly. If the SDK is critical to your checkout flow, consider pinning a version and monitoring the repository.