mediaburst/clockworksms
A PHP client for the Clockwork SMS API that lets you send single or bulk text messages, check credits, and handle delivery reports. Easy to integrate into Laravel apps for notifications, alerts, and two-factor codes.
Architecture fit. mediaburst/clockworksms is a thin client for the Clockwork SMS REST API (a UK/IE-focused Mediaburst gateway). There is no persistence, no queueing, no domain model — it is a transport adapter. That is architecturally good: it is a small, replaceable boundary that can sit behind an internal SmsGateway interface without contaminating the domain layer. Expect a single client class with send(), credit(), deliveryReport()-style methods returning a result object or array with a success flag and error code. Do not expect framework features beyond (possibly) a Laravel service provider and facade alias.
Integration feasibility. Low. Composer install, one config value (API key, plus optional from-name/from-address), and a handful of calls. Realistically a half-day proof of concept for one engineer. The integration cost is not the code — it is the decisions around it (vendor lock-in, error semantics, secrets handling).
Technical risk. The material risk here is lifecycle, not complexity:
file_get_contents, which is untestable and mock-hostile).Key questions to answer before committing:
Recommendation: viable as a contained adapter for a low-volume transactional SMS need, provided it is wrapped and vendored. Not appropriate as a strategic, long-lived dependency without ownership.
Stack fit. Fits any Laravel/PHP application as an outbound side-effect service. The correct pattern is:
app/Services/Sms/ClockworkGateway.php implementing an internal SmsGateway contract (send(to, body): SmsResult).CLOCKWORK_API_KEY), never in config/ defaults committed to VCS.config/services.php or a dedicated config/sms.php, cached in production.Migration path. Greenfield: trivial, direct adapter. Brownfield: define the SmsGateway interface first, implement it with the existing provider, then add Clockwork as a second implementation. This makes vendor swap a one-line container binding and enables A/B or failover between providers later.
Compatibility. Pin the package version explicitly in composer.json (do not float ^1.0 on an abandoned package). Run the test suite under the target PHP minor version before merge. If PHP 8 compatibility fails, the fallback is a fork-and-vendor: copy the ~200–400 lines into app/Support/Clockwork/ or a private Composer VCS repository, add type declarations, and own it. Given the code volume, this is cheap and probably the right call regardless.
Sequencing.
SmsGateway contract and result value object.Maintenance. Treat as owned source, not as a dependency. Budget a small annual review (PHP version bump, API drift, credential rotation) plus a standing ticket to evaluate maintained alternatives. Because the code is tiny, the ongoing cost is hours, not days — but it is non-zero and it will not be handled by the upstream maintainer.
Support. Two distinct support surfaces: the service (Clockwork — account, billing, delivery, sender IDs) and the package (abandoned). Escalation for delivery issues goes to the vendor; escalation for bugs goes to us. Document this in the runbook so on-call does not chase a dead GitHub issue tracker.
Scaling. Bottleneck is the vendor (throughput caps, per-country sender rules, cost per segment), not the client. The client-side scaling concerns are: synchronous sends blocking web requests, connection reuse, and timeouts. Standard answer — queue all sends, set explicit connect/read timeouts (e.g. 2s/5s), cap concurrency against the vendor's rate limit, and track segment counts since billing is per 160-char GSM segment.
Failure modes to instrument.
success=false but HTTP 200. Any code that ignores the return value will drop messages without a trace. Enforce return-value checking via the adapter contract.Ramp-up. Very low for a competent Laravel developer — under a day to be productive, most of it spent on the vendor's error taxonomy and delivery-report semantics rather than the package. The knowledge that actually matters (SMS encoding, segment billing, carrier filtering, opt-out compliance) is not in this package and must come from the vendor docs and our own runbook. Write that runbook early; it outlives the dependency.
How can I help you explore Laravel packages today?