- How do I install the FastBill Laravel wrapper in my project?
- Use Composer to install the package with `composer require dvelopment/fastbill`. Ensure your Laravel project meets the wrapper’s PHP version requirements (check the package’s docs or run `composer show dvelopment/fastbill`). Register the service provider in `config/app.php` if required, though minimal setups may work without it.
- Does this wrapper support Laravel’s service container and dependency injection?
- Yes, the wrapper is designed as an OOP PHP client, so you can bind it to Laravel’s service container via a service provider. For example, register it in `AppServiceProvider` using `bind()` to inject `FastBill` instances into controllers or other services. Facades may also be available for convenience.
- What Laravel versions does the FastBill wrapper support?
- The package does not explicitly state Laravel version support, but it requires PHP 8.0+. For Laravel 9+, ensure compatibility by checking the wrapper’s dependencies (e.g., Guzzle or other HTTP clients) and PHP version constraints. Test thoroughly if using newer Laravel features like model events or queues.
- How does the wrapper handle FastBill API authentication (OAuth/API keys)?
- The wrapper likely abstracts authentication behind a config file or environment variables. Check for a `config/fastbill.php` file or documentation on how to set API keys. If not, you may need to extend the wrapper or manually configure it via Laravel’s `config()` helper or service provider bindings.
- Can I use this wrapper for webhooks from FastBill (e.g., invoice paid events)?
- The wrapper does not explicitly mention webhook support, so you’ll need to verify if it includes signature validation or event dispatching. If not, you can manually handle webhooks in Laravel’s `routes/web.php` or `app/Http/Kernel.php` middleware, then dispatch custom events (e.g., `InvoicePaid`) for consistency.
- Is the FastBill wrapper actively maintained? How often is it updated?
- The package has low adoption (3 stars, 0.195 score) and no visible repository link, raising concerns about maintenance. Check the GitHub repository (if accessible) for commit frequency or open issues. If inactive, consider forking it or building a custom solution with Guzzle for better control.
- Does the wrapper support Laravel queues for async operations (e.g., bulk invoicing)?
- There’s no indication the wrapper supports Laravel queues out of the box. For async operations, wrap API calls in a job (e.g., `FastBillInvoiceJob`) and dispatch it via `dispatch()` or `dispatchSync()`. This requires manual implementation but integrates seamlessly with Laravel’s queue system.
- What happens if the FastBill API changes or deprecates endpoints?
- Since the wrapper lacks active maintenance, API changes could break functionality. Monitor FastBill’s API docs for updates and test the wrapper against their sandbox environment. If issues arise, you may need to fork the package or extend it to handle new endpoints or deprecated calls.
- Are there alternatives to this wrapper for Laravel FastBill integration?
- Yes, you can use GuzzleHTTP directly with a custom service class for more control. Libraries like `spatie/array-to-object` or `spatie/laravel-activitylog` can help parse responses or log events. However, a dedicated wrapper reduces boilerplate for auth, rate limiting, and error handling.
- How do I test the FastBill wrapper in my Laravel app?
- Use FastBill’s sandbox API to test without real charges. Mock HTTP responses with Laravel’s `Http::fake()` or `Mockery` to verify wrapper behavior. Test critical paths like invoice creation, payment processing, and error scenarios (e.g., invalid API keys). If the wrapper lacks tests, add unit tests for your custom logic.