smsapi/php-client
SMSAPI PHP Client is a Composer package for integrating your PHP app with the SMSAPI.COM and SMSAPI.PL APIs. Since v3 it supports PSR-17 and PSR-18 HTTP clients, with a ready-made Curl adapter. Install via composer require smsapi/php-client.
curl_close() deprecation, so the package is usable on the next PHP minor without log noise.Http::fake() will not intercept traffic. Test seams must come from our own wrapper interface (bind a fake implementation), not Laravel’s HTTP fakes.config/services.php, never read directly from env inside the client.TypeError on failed curl_init() addresses a real crash path, but only when the failure is at connection setup. Post-connection failures still surface as exceptions we must catch; anything running below 4.0.1 on PHP 8.5 will emit deprecation noise and can throw uncaught TypeError.^4.0.1 as the floor — do not accept 4.0.0 on modern PHP.SmsSender interface so the provider is swappable and fakeable.Http::fake() with a fake SmsSender binding for unit tests; use an integration suite against the sandbox for the real client.notifications channel or augment it?Illuminate\Support\Facades\Http or Guzzle, so it sits outside Laravel’s HTTP middleware, retry helper, and fake layer.Http facade) if the package’s surface is too minimal — at which point the package’s value is mostly endpoint/payload knowledge.^4.0.1; test on the PHP version you intend to run in production (include 8.5 in CI if that’s on the roadmap).Http::fake().// app/Providers/SmsServiceProvider.php
public function register() {
$this->app->singleton(SmsSender::class, function ($app) {
return new SmsApiSender(config('services.smsapi.key'));
});
}
SmsDeliveryException.sendSms() dispatches a job) and add logging (SmsSent/SmsFailed events) plus monitoring (Laravel Telescope/Horizon).^8.0 for Laravel 9+); floor the package at ^4.0.1.^4.0.1.^4.0.1 floor so a future dependency downgrade doesn’t reintroduce the curl_init() TypeError on PHP 8.5.sms_attempted, sms_failed) to a table; include transport vs. provider error distinction.| Failure Type | Impact | Mitigation |
|---|---|---|
| Provider API outage | SMS delivery stops | Fallback to email + alerting. |
| Rate limit exceeded | Throttled requests | Exponential backoff + queue delays. |
| Invalid credentials | All SMS fail | Rotate keys via config + monitoring. |
| Silent API changes | Breaking changes go unnoticed | Feature flags + automated API contract checks. |
Transport init failure (curl_init) |
Uncaught TypeError crashes the request/job |
Pin ^4.0.1; catch and normalize in the wrapper; alert on transport error rate. |
| PHP runtime upgrade (8.5+) | Deprecation noise, latent fatal errors | CI matrix includes target PHP version; upgrade the package ahead of runtime upgrades. |
Http::fake()).How can I help you explore Laravel packages today?