- How do I install zeevx/lara-termii in a Laravel application?
- Install it with Composer using composer require zeevx/lara-termii, then publish the package config with the vendor:publish command so the Termii settings land in your config directory. Add your Termii API key, and any sender ID or channel defaults, to your .env file rather than hardcoding them. The service provider registers a container-bound client you can resolve or inject. Because credentials are config-driven, clear or rebuild your config cache after changing values in production.
- Which Laravel and PHP versions does LaraTermii support?
- The package is built for conventional Laravel applications, and the documented usage assumes Laravel 8, 9, 10 or newer alongside a supported PHP version. Always check the require block in the package composer.json against your own PHP and Laravel matrix before upgrading, since framework support can change between releases. If you maintain multiple applications on different Laravel versions, pin the package version per application instead of relying on a floating constraint.
- How do I send an SMS with LaraTermii?
- LaraTermii exposes Termii's SMS surface through a container-bound client obtained via dependency injection or the package facade. You configure credentials and a default sender ID once, then call the SMS methods with the recipient number and message body. Responses are turned into exceptions rather than raw HTTP payloads, so wrap sends in a try/catch where delivery matters. Route outbound SMS through a queued job for anything that is not on a critical request path.
- How do I send and verify OTP tokens with LaraTermii?
- The package wraps Termii's token endpoints, so you can request an OTP for a phone number and then verify the code the user submits. Termii handles generation and delivery, while your application decides on expiry, attempt limits and what happens after successful verification. Store any attempt counters or lockouts on your side rather than assuming the gateway enforces your business rules. Treat the verified phone number as unconfirmed until the verification call succeeds.
- Can I use Termii messaging in Laravel notifications?
- Yes. LaraTermii is designed to plug into Laravel's notification system so you can add Termii-powered SMS alongside mail and database channels. You define the channel on your notification class and return the rendered message content from its toTermii or equivalent method. Keep notification content short and avoid putting secrets in message bodies. Test notifications with a fake or log driver before pointing them at real numbers.
- How do I configure my Termii API key, sender ID and channels?
- Configuration is published into a package config file and read from environment variables, which fits standard secret management and config caching. Set your API key and default sender ID there, and override the sender or channel per message when a specific use case needs it. Never commit real credentials, and use separate keys for local, staging and production. If you run config caching, remember that env changes require a fresh config cache.
- What changed in LaraTermii 1.3.0 and is the upgrade breaking?
- Version 1.3.0 adds an eSIM sub-client, splits the client into per-product traits such as Concerns\Engage and Concerns\Sotel, and removes sendMessageWithNumber(), which targeted an endpoint Termii documents but does not actually serve. The trait refactor is described as public-API preserving, so existing SMS and OTP call sites should keep working. The upgrade is still worth treating as deliberate: grep your codebase for sendMessageWithNumber and delete or reroute those call sites first, then run your SMS and OTP test suite against 1.3.0. Do not bundle eSIM evaluation into the same pull request as the upgrade.
- How does the eSIM sub-client handle authentication and bearer token caching?
- The eSIM client uses a bearer-token exchange, which is a second authentication model inside the same package boundary. The release notes do not state the token lifetime, whether a 401 triggers a refresh, or whether tokens are cached beyond a single request. Until that is confirmed, assume the exchange may happen per call, which adds latency and rate-limit exposure, and scrutinise long-running Octane workers where in-process caching behaves differently than in a queue worker.
- Are createEsim() and purchasePlan() idempotent and safe to retry in a queue?
- No idempotency key is documented for these methods, and they trigger real-money operations, so a retried job could double-charge. Do not wire them into an automatic retry queue until you have confirmed idempotency behaviour with the maintainer or tested it against a sandbox. In the meantime, add your own guard, such as a unique job key or a database record that marks an attempt as in flight, and keep these calls out of fire-and-forget flows. This is the highest-risk area of the release and should be resolved before any production integration.
- How do I test LaraTermii without sending real messages or charging real money?
- For SMS and OTP, fake the underlying client or use Laravel's HTTP fakes so your test suite never hits Termii, then assert on the payloads your code builds. Test your exception handling too, including cases like TermiiException::esimAuthenticationFailed(), so you can tell bad credentials apart from an expired token. For eSIM, confirm whether Termii provides a sandbox and whether it covers all the endpoints you intend to use, and leave real-money calls out of automated tests entirely.