vonage/client-core
Core PHP client library for Vonage APIs (PHP 8.1+). Create a Vonage\Client with your API key/secret, make requests, and optionally customize base API URLs for testing. Install via Composer (vonage/client) or use core with your own HTTP client.
Pros:
illuminate/http-client or guzzlehttp/guzzle).Vonage\ClientCore\Events\CallConnected).Cons:
Http\Client or Guzzle can replace the default HTTP layer if needed.Vonage\ClientCore\Exception\VonageException) can be mapped to Laravel’s exception handling.route:web middleware for handling Vonage callbacks.illuminate/support or symfony/http-client. Mitigate via composer.json constraints.ShouldQueue jobs or process managers.mockery or pestphp for testing.VonageWebhookHandler) be created?laravel-cache) may be needed for high-frequency calls.Log facade or a tool like Sentry..env or a secrets manager (e.g., AWS Secrets Manager)?Http\Client or Guzzle for consistency.Log facade (PSR-3 compliant) instead of the package’s default logger.VonageCallStarted) for reactivity.laravel-queue with database or redis driver).PestPHP or PHPUnit with mockery for Vonage API mocking.Laravel Debugbar or Sentry for API call tracking.composer require vonage/client-core
.env:
VONAGE_KEY=your_api_key
VONAGE_SECRET=your_api_secret
VONAGE_REGION=us
app/Services/VonageService.php):
use Vonage\ClientCore\Client;
use Vonage\ClientCore\Credentials\BasicCredentials;
class VonageService {
public function __construct(
public Client $vonageClient
) {}
public static function boot(): void {
$credentials = new BasicCredentials(
config('vonage.key'),
config('vonage.secret')
);
$client = new Client($credentials, config('vonage.region'));
app()->bind(Client::class, fn() => $client);
}
}
routes/web.php:
Route::post('/vonage/webhook', [VonageWebhookController::class, 'handle']);
use Illuminate\Bus\Queueable;
use Vonage\ClientCore\Client;
class SendSmsJob implements ShouldQueue {
use Queueable;
public function handle(Client $vonageClient) {
$vonageClient->sms()->send(...);
}
}
event(new VonageCallStarted($callSid));
illuminate/support compatibility.vonage/client-core for updates and Laravel compatibility.Log::stack or external tools like ELK).VonageException or HTTP 429 (rate limits) via Laravel’s HandleExceptions or a monitoring tool..env updates for VONAGE_KEY/VONAGE_SECRET using Laravel Forge or Envoyer..env credentials and Vonage API keys.Vonage\ClientCore\RetryStrategy.php artisan queue:workHow can I help you explore Laravel packages today?