- How do I install benhawker/pipedrive in a Laravel project?
- Run `composer require benhawker/pipedrive` in your project directory. The package is Composer-based, so no additional Laravel-specific setup is required beyond requiring it. Bind the client to Laravel’s service container in a service provider for dependency injection if needed.
- Does this package support Laravel’s Eloquent ORM for Pipedrive entities?
- No, this package is a generic PHP client and doesn’t include Eloquent integration. You’ll need to manually map Pipedrive responses to Eloquent models or use a custom wrapper. Consider extending the library or using a facade to bridge the gap.
- What Laravel versions are compatible with benhawker/pipedrive?
- The package itself doesn’t enforce Laravel-specific dependencies, so it works with any Laravel version supporting PHP 7.4+. However, ensure your Laravel version aligns with the PHP version required by the package (check Packagist for details).
- Can I handle Pipedrive webhooks with this library?
- The library doesn’t include built-in webhook support. You’ll need to use Laravel’s `HandleIncomingWebhook` or queue listeners to process Pipedrive webhooks. The client can still fetch or update data triggered by these events.
- How do I securely manage Pipedrive API keys in Laravel?
- Store your API key in Laravel’s `.env` file (e.g., `PIPEDRIVE_API_KEY`) and retrieve it via `config('pipedrive.api_key')`. Avoid hardcoding keys in your application. For multi-tenant apps, consider using Laravel’s `config` or a secrets manager.
- Does this package support file uploads to Pipedrive?
- Yes, the library includes basic file upload functionality. However, you may need to integrate Laravel’s `Storage` facade to handle file paths or streams before uploading. Check the README for the exact method signature.
- Are there alternatives to benhawker/pipedrive for Laravel?
- Yes, alternatives include the official Pipedrive PHP SDK (if available) or generic HTTP clients like Guzzle with custom wrappers. However, this package offers a simpler, fluent interface for common Pipedrive operations, reducing boilerplate compared to raw API calls.
- How do I handle API errors or rate limits in this library?
- The library uses generic PHP exceptions. For Laravel, map these to `HttpException` or `ValidationException` as needed. Implement retry logic with Laravel’s `retry` helper or use middleware to handle rate limits (e.g., exponential backoff).
- Is this package suitable for high-volume Pipedrive operations?
- The library is lightweight but lacks async or batch operation support. For high-volume tasks, consider queueing requests via Laravel’s queues or implementing custom batch processing. Monitor rate limits to avoid throttling.
- How can I extend this library to support custom Pipedrive fields or endpoints?
- The library’s basic blocks can be extended by subclassing the `Pipedrive` class or adding custom methods. Use Laravel’s service container to bind your extended class. Refer to Pipedrive’s API docs to ensure compatibility with unsupported endpoints.