- How do I install plivo/plivo-php in a Laravel app, and which PHP versions are supported?
- Run composer require plivo/plivo-php in your project directory. The SDK supports PHP 7.3 and newer, so any currently supported Laravel release on PHP 8.x satisfies the runtime floor. There is no Laravel-specific installer or config publishing step, so after install you bind or inject the RestClient yourself.
- Is plivo/plivo-php a Laravel package with a service provider and facade?
- No. plivo/plivo-php is a thin, framework-agnostic PHP SDK, not a Laravel package: it ships no service provider, facade, config file, or publishable assets. In Laravel you write a small service provider to bind the RestClient as a singleton and optionally wrap it in your own gateway class. That keeps vendor types out of controllers and makes the integration easy to replace later.
- How do I configure Plivo credentials in Laravel?
- The SDK resolves credentials from the PLIVO_AUTH_ID and PLIVO_AUTH_TOKEN environment variables, which fits Laravel's .env convention. Put the values in .env, expose them through config/services.php, and construct the RestClient from config('services.plivo.*') inside a service provider. Remember to run php artisan config:cache after changes in production.
- How do I send an SMS or make a voice call with plivo/plivo-php in Laravel?
- Instantiate the RestClient, then call messages->create() for SMS or calls->create() for voice. Wrap these calls behind your own SmsSender or VoiceGateway interface so controllers stay vendor-neutral. The SDK is stateless and holds no framework coupling, so it is easy to bind as a container singleton. The provided assessment notes no built-in retry, backoff, or idempotency keys, so add your own retry and dedupe logic for production sends.
- How do I generate Plivo XML for voice call flows in Laravel?
- Use the Plivo\XML\Response builder to construct the XML document, then return it from a Laravel route with a text/xml content type for Plivo's voice answer webhook. The XML builder is the main reason to use the SDK on the voice side. Keep this in a dedicated controller or action so call-flow markup stays separate from REST API calls.
- Does plivo/plivo-php verify Plivo webhook signatures?
- The provided assessment finds no evidence in the README of first-class X-Plivo-Signature validation, so treat signature verification as your responsibility. Implement validation in middleware or a dedicated webhook controller before dispatching domain events. Verify against Plivo's documented signing scheme and reject unsigned or mismatched requests.
- Will plivo/plivo-php conflict with Laravel's Guzzle version?
- The SDK pulls its own HTTP client, which can collide with the Guzzle range pinned by your Laravel lockfile. Before committing, test in a scratch branch with composer why-not and composer update --dry-run. If constraints conflict, isolate the SDK or pin versions explicitly rather than discovering the problem during deployment.
- Does the Plivo PHP SDK support WhatsApp templates and interactive messages?
- Yes, the SDK exposes Plivo's WhatsApp surface, but the payloads are schema-heavy: templates and interactive messages are passed as raw JSON strings and validated server-side. You cannot fully unit-test template approval or rendering locally. Treat WhatsApp as a separate, well-abstracted concern rather than folding it into a generic SMS sender.
- How can I test a Plivo integration in Laravel without hitting the real API?
- There is no documented SDK test mode or sandbox in the provided material, so design for testability: put Plivo calls behind your own interface and swap in a fake during tests. Because the RestClient is a plain object, you can mock or inject a test double without Laravel-specific tooling. For voice flows, assert on the generated XML string rather than calling Plivo.
- Is plivo/plivo-php maintained, and what are the alternatives to Twilio or Vonage?
- plivo/plivo-php is MIT licensed, Composer-installable, and has a changelog and releases, but the assessment flags 111 stars, zero dependents, and single-vendor maintenance. That means you absorb integration edge cases earlier than with a larger community. The thin REST wrapper keeps exit costs low: wrapping calls behind your own gateway makes a later move to Twilio, Vonage, or raw Http:: calls a bounded change.